Skip to content

Stdlib: Locale getDisplayLanguage/Region/Script/Variant + getAllVariants (#20755)#20791

Merged
PurHur merged 1 commit into
masterfrom
fix/20755-locale-display-methods
Jul 19, 2026
Merged

Stdlib: Locale getDisplayLanguage/Region/Script/Variant + getAllVariants (#20755)#20791
PurHur merged 1 commit into
masterfrom
fix/20755-locale-display-methods

Conversation

@PurHur

@PurHur PurHur commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds Locale::getDisplayLanguage / getDisplayRegion / getDisplayScript / getDisplayVariant / getAllVariants plus procedural locale_get_display_* / locale_get_all_variants on the existing English-approximation VmLocale path (php-src ext/intl/locale/).
  • Note: getKeywordValue / setKeywordValue are not in php-src 8.4 locale.stub.php; keyword maps remain via getKeywords (Stdlib: Locale::canonicalize()/parseLocale()/composeLocale()/getKeywords() missing after #6696/#20036 (ext/intl/locale) #20738).
  • Spine/inventory → 5840/5840 for the 10 new ext/intl/ files. Gen-0 sidecar stamp remains stale on master (waive with BOOTSTRAP_ALLOW_STALE_SIDECAR=1; blob refresh is a separate bootstrap PR).

php-src reference: ext/intl/locale/locale.stub.php, locale_methods.c
PHP-in-PHP: no new C runtime.

Closes #20755

Test plan

  • PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/issue_20755_locale_display_methods.php — matches Zend 8.2+intl
  • PHP_COMPILER_PROFILE=8.4 php bin/jit.php test/repro/issue_20755_locale_display_methods.php
  • vendor/bin/phpunit --filter test_locale_display_methods
  • vendor/bin/phpunit --filter locale_display_methods test/compliance/VMTest.php
  • php script/bootstrap-inventory.php --check → OK 5840/5840
  • spine count/coverage sync OK; sidecar waived (master-preexisting stale stamp)

Verification transcript (VM = Zend)

getDisplayLanguage=1 … getAllVariants=1
lang=English region=United States script=Simplified Han variant=Computer
allv=["NEDIS","ROJAZ","ALBA"] proc=French

Made with Cursor

…nts (#20755)

Add php-src Locale display-component getters and getAllVariants (plus
procedural aliases) on the existing English/ICU-fallback VmLocale path.
Note: Locale::getKeywordValue/setKeywordValue are not in php-src 8.4
locale.stub.php — getKeywords already covers keyword maps (#20738).

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdlib: Locale::getDisplayLanguage()/getDisplayRegion()/getKeywordValue() missing after #20738 (ext/intl/locale)

1 participant