Repository navigation
Stdlib: Locale::canonicalize()/parseLocale()/composeLocale()/getKeywords() missing after #6696/#20036 (ext/intl/locale) #20738
Copy link
Copy link
Closed
Labels
area:vmVirtual machineVirtual machineenhancementNew feature or requestNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimSpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsPhase 4 – stdlib for web appsstdlib
Description
Activity
- addedenhancementNew feature or requestNew feature or requestphase-4:stdlibPhase 4 – stdlib for web appsPhase 4 – stdlib for web appsarea:vmVirtual machineVirtual machineimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimSpec complete: repro, php-src ref, done-when — safe for workers to claim
on Jul 18, 2026 claim: PHP Compiler Ext — I/O & Crypto — starting this run (Locale canonicalize/parseLocale/composeLocale/getKeywords).
Merged via #20750.
Verification:
- Issue repro PROFILE=8.4: canonicalize/parseLocale/composeLocale/getKeywords present;
canonicalize('en-US')→en_US vendor/bin/phpunit --filter locale_canonicalize_parse→ OK (2 tests, VM+JIT)- inventory OK 5818/5818; check-generated-docs OK
php-src:
ext/intl/locale/locale_methods.c— ICUuloc_*FFI + PHP fallbacks inext/intl/VmLocale.php.- Issue repro PROFILE=8.4: canonicalize/parseLocale/composeLocale/getKeywords present;
- added 5 commits that reference this issue
on Jul 19, 2026 Merged #20750 (squash).
Verification transcript:
PHP_COMPILER_PROFILE=8.4 php bin/vm.phpissue repro → methods=1; canonicalize('en-US')=en_USvendor/bin/phpunit --filter locale_canonicalize_parse→ OK (2 tests, VM+JIT)- inventory 5818/5818; check-generated-docs OK
Implementation:
ext/intl/VmLocale.php+ Locale* method classes / locale_* procedural aliases; ICUuloc_*FFI with PHP fallbacks.claim: PHP Compiler STD Lib — continuing #20750 (rebase + AOT canonicalize lowering this run)
Trust probe:
make bootstrap-selfhost-linkOK- inventory OK 5810/5810 (release-readiness); branch regen → 5818/5818 with Locale files
user_release_ready: no— spine-coverage / north-star5-fast red onNestedTernaryRejector.php(pre-existing; not this PR)
Metadata
Metadata
Assignees
Labels
area:vmVirtual machineVirtual machineenhancementNew feature or requestNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimSpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsPhase 4 – stdlib for web appsstdlib
Category
stdlib· php-src-strict · ext/intl Locale · pillar 4Problem
Localeis advertised after #6696 / #9576 / #20036 (getDefault,getDisplayName,lookup,filterMatches,acceptFromHttp, …), but the BCP-47 canonicalize/parse/compose/keywords surface from php-src is still missing. Call sites that doLocale::canonicalize()hit undefined-method fatals despiteclass_exists('Locale').method_exists(Locale::class, 'getDefault')truetruemethod_exists(..., 'lookup')/filterMatches/acceptFromHttptruetruemethod_exists(..., 'canonicalize')truefalsemethod_exists(..., 'parseLocale')truefalsemethod_exists(..., 'composeLocale')truefalsemethod_exists(..., 'getKeywords')truefalseLocale::canonicalize('en-US')en_US(ICU form)Error: Call to undefined static methodAlso still missing (same stub; may ship in follow-ups):
getAllVariants,getDisplayLanguage/Region/Script/Variant,getDisplayKeyword*,isRightToLeft,addLikelySubtags,minimizeSubtags.php-src reference
ext/intl/locale/locale.stub.php—canonicalize/parseLocale/composeLocale/getKeywordsext/intl/locale/locale_methods.c—locale_canonicalize/locale_parse/locale_compose/locale_get_keywordsPHP implementation target
ext/intl/VmLocale.php(+ method classes besideLocaleLookup/LocaleFilterMatches) — PHP-in-PHP using existing BCP-47 parser helpers; thin ICU FFI only if canonicalize needsuloc_canonicalizeRepro
Done when
canonicalize/parseLocale/composeLocale/getKeywordsexist and match Zend/intl on a small BCP-47 fixture set (including@currency=keywords).phptundertest/compliance/cases/intl/