Syntax:string ReflectionExtension::getVersion (void)
Parameters:This function takes no parameters.
Returned value:This function returns the version of the specified extension.The following programs illustrate the ReflectionExtension function::getVersion() in PHP:
Program 1:
// Extension definition
$A
=
’DOM’
;
// Using ReflectionExtension() above
// specified extension
$extension
=
new
ReflectionExtension (
$A
);
// Call the getVersion() function
$B
=
$extension
-> getVersion();
// Get the version
// specified extension
var_dump (
$B
);
?>
Output:string (8) "20031129"
Program 2:
// Using ReflectionExtension() over
// xml extension
$extension
=
new
ReflectionExtension (
’xml’
);
// Call the getVersion() function and
// Get the version of the specified extension
var_dump (
$extension
-> getVersion());
?>
Output:string (23) "7.0.33-0ubuntu0.16.04.7"
Link:https://www.php.net/manual/en/reflectionextension.getversion.php