Category
bug · php-src-strict · Locale display names
Problem
VmLocale::getDisplayName / getDisplayLanguage / getDisplayRegion explicitly unset($displayLocale) and return a fixed English approximation. Zend uses ICU uloc_getDisplayName (etc.) so Locale::getDisplayName('en_US', 'fr') is French. Keyword display APIs already call ICU; name/language/region/script/variant still stub English.
| Repro |
Zend 8.2+ |
VM (2026-07-24) |
Locale::getDisplayName('en_US', 'fr') |
anglais (États-Unis) |
English (United States) |
Locale::getDisplayLanguage('en_US', 'fr') |
anglais |
English |
Locale::getDisplayRegion('en_US', 'fr') |
États-Unis |
United States |
php-src reference
PHP implementation target
ext/intl/VmLocale.php — wire getDisplayName/getDisplayLanguage/getDisplayRegion/getDisplayScript/getDisplayVariant through ICU like getDisplayKeyword* (reuse ulocDisplay* FFI path)
- PHP-in-PHP; thin ICU ABI only if already used for keywords
Repro
./script/docker-exec.sh -- bash -lc 'cat >/tmp/locale_display_fr.php <<'"'"'PHP'"'"'
<?php
echo Locale::getDisplayName("en_US", "fr"), "\n";
echo Locale::getDisplayLanguage("en_US", "fr"), "\n";
echo Locale::getDisplayRegion("en_US", "fr"), "\n";
PHP
php /tmp/locale_display_fr.php
php bin/vm.php /tmp/locale_display_fr.php'
Done when
Category
bug· php-src-strict · Locale display namesProblem
VmLocale::getDisplayName/getDisplayLanguage/getDisplayRegionexplicitlyunset($displayLocale)and return a fixed English approximation. Zend uses ICUuloc_getDisplayName(etc.) soLocale::getDisplayName('en_US', 'fr')is French. Keyword display APIs already call ICU; name/language/region/script/variant still stub English.Locale::getDisplayName('en_US', 'fr')anglais (États-Unis)English (United States)Locale::getDisplayLanguage('en_US', 'fr')anglaisEnglishLocale::getDisplayRegion('en_US', 'fr')États-UnisUnited Statesphp-src reference
ext/intl/locale/locale_methods.c—uloc_getDisplayName/uloc_getDisplayLanguage/uloc_getDisplayCountryPHP implementation target
ext/intl/VmLocale.php— wiregetDisplayName/getDisplayLanguage/getDisplayRegion/getDisplayScript/getDisplayVariantthrough ICU likegetDisplayKeyword*(reuseulocDisplay*FFI path)Repro
Done when
$displayLocalechanges output to match Zend/ICU for name/language/region (and script/variant if in scope)nulldisplay locale still sensible vs Zend.phpt; php-src-strict