Category
stdlib · php-src-strict · ext/intl Locale · pillar 4
Problem
Locale is 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 do Locale::canonicalize() hit undefined-method fatals despite class_exists('Locale').
| Repro |
Zend (intl) |
VM PROFILE=8.4 (2026-07-18) |
method_exists(Locale::class, 'getDefault') |
true |
true |
method_exists(..., 'lookup') / filterMatches / acceptFromHttp |
true |
true |
method_exists(..., 'canonicalize') |
true |
false |
method_exists(..., 'parseLocale') |
true |
false |
method_exists(..., 'composeLocale') |
true |
false |
method_exists(..., 'getKeywords') |
true |
false |
Locale::canonicalize('en-US') |
en_US (ICU form) |
Error: Call to undefined static method |
Also still missing (same stub; may ship in follow-ups): getAllVariants, getDisplayLanguage/Region/Script/Variant, getDisplayKeyword*, isRightToLeft, addLikelySubtags, minimizeSubtags.
php-src reference
PHP implementation target
Repro
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && PHP_COMPILER_PROFILE=8.4 php bin/vm.php -r "
\$m=[\"canonicalize\",\"parseLocale\",\"composeLocale\",\"getKeywords\"];
foreach (\$m as \$n) echo \$n,\"=\",(method_exists(Locale::class,\$n)?\"1\":\"0\"),PHP_EOL;
try { var_export(Locale::canonicalize(\"en-US\")); echo PHP_EOL; }
catch (Throwable \$e) { echo get_class(\$e),\": \",\$e->getMessage(),PHP_EOL; }
"'
Done when
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/