Category
stdlib · php-in-php · bootstrap
Problem
phpversion($extension) and extension_loaded($extension) read a hard-coded two-entry list in ext/standard/VmInfo.php (LOADED_EXTENSIONS = ['standard', 'types']).
Compiled modules under ext/*/ (zip, spl, filter, bcmath, mbstring, intl, session) register classes/functions but do not appear in extension introspection:
| Probe |
Today (vm.php) |
extension_loaded('zip') |
false while class_exists('ZipArchive') is true |
phpversion('zip') |
false |
extension_loaded('spl') |
false while class_exists('ArrayObject') is true |
Parent issue #4839 tracks get_loaded_extensions() full registry; this issue is the phpversion() / extension_loaded() consumer slice workers can land incrementally.
php-src reference
Repro (today)
<?php
var_export(extension_loaded('zip'));
echo "\n";
var_export(class_exists('ZipArchive'));
echo "\n";
var_export(phpversion('zip'));
echo "\n";
var_export(phpversion('standard'));
echo "\n";
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php repro.php
php bin/vm.php repro.php'
Scope (this repo)
| Layer |
Files |
| Registry |
ext/standard/VmInfo.php — build extension name set from Runtime module list / ext/*/Module.php |
| Builtins |
extension_loaded.php, phpversion() helper |
| JIT |
lib/JIT/Builtin/Type/JitInfo.php |
| Tests |
extend test/compliance/cases/stdlib/extension_loaded.phpt |
PHP-in-PHP: derive registry in PHP; delete any duplicate hard-coded tables in C when present.
Done when
Labels
stdlib, php-in-php, bootstrap, implementation-ready
Category
stdlib·php-in-php·bootstrapProblem
phpversion($extension)andextension_loaded($extension)read a hard-coded two-entry list inext/standard/VmInfo.php(LOADED_EXTENSIONS = ['standard', 'types']).Compiled modules under
ext/*/(zip, spl, filter, bcmath, mbstring, intl, session) register classes/functions but do not appear in extension introspection:extension_loaded('zip')falsewhileclass_exists('ZipArchive')is truephpversion('zip')falseextension_loaded('spl')falsewhileclass_exists('ArrayObject')is trueParent issue #4839 tracks
get_loaded_extensions()full registry; this issue is thephpversion()/extension_loaded()consumer slice workers can land incrementally.php-src reference
ext/standard/info.c—PHP_FUNCTION(phpversion),extension_loadedmain/php_version.h— per-extension version stringsRepro (today)
Scope (this repo)
ext/standard/VmInfo.php— build extension name set fromRuntimemodule list /ext/*/Module.phpextension_loaded.php,phpversion()helperlib/JIT/Builtin/Type/JitInfo.phptest/compliance/cases/stdlib/extension_loaded.phptPHP-in-PHP: derive registry in PHP; delete any duplicate hard-coded tables in C when present.
Done when
extension_loaded('zip')true whenext/zip/Module.phploaded;phpversion('zip')returns compiler version string (or module version constant)extension_loaded('spl')true when SPL module registersArrayObject./script/ci-fast.sh --filter extension_loadedgreenget_loaded_extensions()list parity)Labels
stdlib,php-in-php,bootstrap,implementation-ready