Category
php-in-php | stdlib | runtime
Problem
Introspection builtins (phpversion, php_sapi_name, php_uname, version_compare, extension_loaded, get_loaded_extensions) split between PHP ext/standard/*.php VM handlers and a ~400-line C translation unit linked for JIT/AOT:
lib/AOT/runtime/phpc_info.c (registered in lib/AOT/Linker.php)
lib/JIT/Builtin/StringInfo.php bitcode link
ext/standard/JitInfo.php LLVM lowering
Self-host M5 should execute these from compiled PHP in ext/standard/, not maintain parallel C string tables.
php-src reference
Repro (C runtime today)
./script/docker-exec.sh -- bash -lc 'wc -l lib/AOT/runtime/phpc_info.c
grep phpc_info lib/AOT/Linker.php
grep -l phpc_info lib/JIT/Builtin/*.php ext/standard/JitInfo.php'
VM path already works for basic calls:
./script/docker-exec.sh -- bash -lc 'php bin/vm.php -r "var_export(version_compare(\"8.3.0\",\"8.2.0\",\">\"));"'
JIT/AOT still require phpc_info.c symbols until lowered from PHP.
Scope (this repo)
Done when
Verification
./script/docker-exec.sh -- bash -lc '! grep -r phpc_info lib/AOT/Linker.php lib/JIT/Builtin/StringInfo.php 2>/dev/null || test $? -eq 1'
./script/docker-exec.sh -- vendor/bin/phpunit --filter 'Phpversion|VersionCompare|ExtensionLoaded'
make bootstrap-selfhost-link # smoke when JIT symbols change
Pairs with parity issues #5817, #5955; advances #1492 PHP-in-PHP shrink-C-runtime goal.
Category
php-in-php|stdlib|runtimeProblem
Introspection builtins (
phpversion,php_sapi_name,php_uname,version_compare,extension_loaded,get_loaded_extensions) split between PHPext/standard/*.phpVM handlers and a ~400-line C translation unit linked for JIT/AOT:lib/AOT/runtime/phpc_info.c(registered inlib/AOT/Linker.php)lib/JIT/Builtin/StringInfo.phpbitcode linkext/standard/JitInfo.phpLLVM loweringSelf-host M5 should execute these from compiled PHP in
ext/standard/, not maintain parallel C string tables.php-src reference
ext/standard/info.c—phpversion,php_sapi_name,php_uname,extension_loaded,get_loaded_extensionsext/standard/versioning.c—version_compareRepro (C runtime today)
VM path already works for basic calls:
./script/docker-exec.sh -- bash -lc 'php bin/vm.php -r "var_export(version_compare(\"8.3.0\",\"8.2.0\",\">\"));"'JIT/AOT still require
phpc_info.csymbols until lowered from PHP.Scope (this repo)
ext/standard/phpversion.php,php_uname.php,version_compare.php,extension_loaded.php,get_loaded_extensions.php,php_sapi_name.phpwith sharedVmInfohelperlib/JIT/Builtin/Info*.phplowerings mirroring VM semantics (replaceStringInfobitcode link)lib/AOT/runtime/phpc_info.c; remove fromlib/AOT/Linker.phpandlib/JIT/Builtin/StringInfo.phpDone when
phpc_info.c(grep clean)lib/AOT/runtime/(note in PR body)phpversion,version_compare,extension_loadedstay greenscript/capability-matrix.phpregeneration shows JIT/AOTyeswithout C fallback notesVerification
Pairs with parity issues #5817, #5955; advances #1492 PHP-in-PHP shrink-C-runtime goal.