Category
bug · php-src-strict
Problem
locale_lookup() already has a PHP implementation in ext/intl/VmLocale.php, and the VM path returns the php-src result for ordinary lookup cases. The JIT entrypoint in ext/intl/locale_lookup.php still hard-fails with RuntimeException: locale_lookup() JIT lowering not implemented; use VM, so the same builtin diverges by backend instead of matching Zend/php-src.
| Repro |
Zend / php-src expected |
JIT (2026-08-18) |
locale_lookup([\"de-DE\",\"de\"], \"de-CH\", true, \"en\") |
\"de\" |
RuntimeException: locale_lookup() JIT lowering not implemented; use VM |
VM/reference confirmation in this tree today:
./script/docker-exec.sh -- bash -lc 'php test/repro/issue_25198_locale_lookup_named.php' prints lookup_pos=de and lookup_named=de
./script/docker-exec.sh -- bash -lc 'php -r '\''require \"vendor/autoload.php\"; var_dump(PHPCompiler\\ext\\intl\\VmLocale::lookup([\"de-DE\",\"de\"], \"de-CH\", true, \"en\"));'\''' prints string(2) \"de\"
php-src reference
PHP implementation target
ext/intl/locale_lookup.php — replace the hardcoded JIT exception with lowering that forwards to the existing PHP/intl helper path
ext/intl/VmLocale.php — keep the lookup semantics SSOT; JIT should reuse this behavior rather than adding new C/runtime logic
lib/JIT/ helper if needed, but keep semantics in PHP-owned intl helpers
Repro
./script/docker-exec.sh -- bash -lc 'php test/repro/issue_25198_locale_lookup_named.php'
./script/docker-exec.sh -- bash -lc 'php -r '\''require "vendor/autoload.php"; $ctx=(new ReflectionClass("PHPCompiler\\JIT\\Context"))->newInstanceWithoutConstructor(); try { (new PHPCompiler\ext\intl\locale_lookup())->call($ctx); } catch (Throwable $e) { echo get_class($e),": ",$e->getMessage(),"\n"; }'\'''
Done when
Category
bug· php-src-strictProblem
locale_lookup()already has a PHP implementation inext/intl/VmLocale.php, and the VM path returns the php-src result for ordinary lookup cases. The JIT entrypoint inext/intl/locale_lookup.phpstill hard-fails withRuntimeException: locale_lookup() JIT lowering not implemented; use VM, so the same builtin diverges by backend instead of matching Zend/php-src.locale_lookup([\"de-DE\",\"de\"], \"de-CH\", true, \"en\")\"de\"RuntimeException: locale_lookup() JIT lowering not implemented; use VMVM/reference confirmation in this tree today:
./script/docker-exec.sh -- bash -lc 'php test/repro/issue_25198_locale_lookup_named.php'printslookup_pos=deandlookup_named=de./script/docker-exec.sh -- bash -lc 'php -r '\''require \"vendor/autoload.php\"; var_dump(PHPCompiler\\ext\\intl\\VmLocale::lookup([\"de-DE\",\"de\"], \"de-CH\", true, \"en\"));'\'''printsstring(2) \"de\"php-src reference
ext/intl/locale/locale_methods.c—locale_lookup()/ RFC 4647 lookup semanticsext/intl/php_intl.stub.php— procedural arginfo / named-parameter surfacePHP implementation target
ext/intl/locale_lookup.php— replace the hardcoded JIT exception with lowering that forwards to the existing PHP/intl helper pathext/intl/VmLocale.php— keep the lookup semantics SSOT; JIT should reuse this behavior rather than adding new C/runtime logiclib/JIT/helper if needed, but keep semantics in PHP-owned intl helpersRepro
Done when
locale_lookup()returns the same result on JIT as php-src/VM for the lookup repro above instead of throwingtest/repro/issue_25198_locale_lookup_named.phpbehave identically on VM and JIT.phptguard undertest/compliance/cases/intl/covers the JIT result path, not only reflection metadata