Category
php-in-php | stdlib | runtime
Problem
version_compare() VM logic already lives in PHP (ext/standard/VmInfo.php, ext/standard/version_compare.php), but JIT/AOT still link a separate ~248-line C translation unit lib/AOT/runtime/phpc_version_compare.c (registered in lib/AOT/Linker.php, called from ext/standard/JitInfo.php via __compiler_version_compare).
Self-host M5 should not maintain duplicate version-string canonicalization in C when VmInfo::version_compare() is the SSOT. Issue #5492 tracks phpc_info.c; this file is a second C runtime copy that must be deleted in the same PHP-in-PHP pass.
php-src reference
Repro (C runtime still linked)
./script/docker-exec.sh -- bash -lc 'wc -l lib/AOT/runtime/phpc_version_compare.c
rg -n phpc_version_compare lib/AOT/Linker.php ext/standard/JitInfo.php'
Today: 248 lib/AOT/runtime/phpc_version_compare.c + __compiler_version_compare symbol in AOT link set.
Compare with PHP SSOT:
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php -r "var_export(version_compare(\"1.0\",\"1.0.0\")); echo PHP_EOL;"'
# int(0)
Enum operand strictness is tracked separately in #5955 (php-src-strict TypeError) — wire the same guards in JIT lowering when deleting C.
Scope (this repo)
| Layer |
Path |
| PHP SSOT |
ext/standard/VmInfo.php, ext/standard/version_compare.php |
| JIT |
ext/standard/JitInfo.php — lower via PHP helper / shared IR, not __compiler_version_compare |
| AOT |
remove lib/AOT/runtime/phpc_version_compare.c from lib/AOT/Linker.php |
| C shrink |
delete file + symbol; no new logic in runtime/*.c |
Done when
Links
Category
php-in-php|stdlib|runtimeProblem
version_compare()VM logic already lives in PHP (ext/standard/VmInfo.php,ext/standard/version_compare.php), but JIT/AOT still link a separate ~248-line C translation unitlib/AOT/runtime/phpc_version_compare.c(registered inlib/AOT/Linker.php, called fromext/standard/JitInfo.phpvia__compiler_version_compare).Self-host M5 should not maintain duplicate version-string canonicalization in C when
VmInfo::version_compare()is the SSOT. Issue #5492 tracksphpc_info.c; this file is a second C runtime copy that must be deleted in the same PHP-in-PHP pass.php-src reference
ext/standard/versioning.c—PHP_FUNCTION(version_compare)/php_version_compareext/standard/info.c— related introspection (see php-in-php: phpc_info.c — delete ~400 lines, phpversion/php_uname/version_compare in ext/standard #5492)Repro (C runtime still linked)
Today:
248 lib/AOT/runtime/phpc_version_compare.c+__compiler_version_comparesymbol in AOT link set.Compare with PHP SSOT:
Enum operand strictness is tracked separately in #5955 (php-src-strict TypeError) — wire the same guards in JIT lowering when deleting C.
Scope (this repo)
ext/standard/VmInfo.php,ext/standard/version_compare.phpext/standard/JitInfo.php— lower via PHP helper / shared IR, not__compiler_version_comparelib/AOT/runtime/phpc_version_compare.cfromlib/AOT/Linker.phpruntime/*.cDone when
lib/AOT/runtime/phpc_version_compare.cdeleted;lib/AOT/Linker.phpno longer lists itversion_compare()results match VM/VmInfo::version_compare()on compliance fixtures (including operator form)TypeErrorrepro green on VM and JIT/AOT after C removal./script/ci-fast.sh --filter VersionCompare(or named compliance) greenlib/AOT/runtime/Links