-
Notifications
You must be signed in to change notification settings - Fork 8k
Description
Description
Description
When calling phpversion($extension)
or using ReflectionExtension::getVersion()
for any PHP extension, the returned value is the current PHP version (8.4.2
in my case) instead of the specific version of the extension.
The only exception observed is the xdebug
extension, which correctly returns its version. This issue affects all other extensions tested, including core extensions like tidy
, curl
, and others.
Steps to Reproduce
-
Use the following code snippet:
<?php echo "PHP Version: " . PHP_VERSION . PHP_EOL; $extensions = ['mysqli', 'curl', 'xdebug']; foreach ($extensions as $ext) { echo "phpversion('$ext'): " . phpversion($ext) . PHP_EOL; $reflection = new \ReflectionExtension($ext); echo "ReflectionExtension::getVersion('$ext'): " . $reflection->getVersion() . PHP_EOL; }
-
Run the script.
Expected Result
phpversion($extension)
and ReflectionExtension::getVersion()
should return the version of the specified extension, not the PHP version.
Actual Result
For most extensions, both functions return the PHP version (8.4.2
) instead of the extension version. The xdebug
extension is the only one that behaves correctly.
PHP Version
8.4.2
Operating System
Tested on Windows 10 throught Wampserver 3.3.7 64 bits.