Skip to content

Stdlib: Locale canonicalize/parseLocale/composeLocale/getKeywords (#20738)#20750

Merged
PurHur merged 2 commits into
masterfrom
agent/ext-io-20738-locale-canonicalize
Jul 19, 2026
Merged

Stdlib: Locale canonicalize/parseLocale/composeLocale/getKeywords (#20738)#20750
PurHur merged 2 commits into
masterfrom
agent/ext-io-20738-locale-canonicalize

Conversation

@PurHur

@PurHur PurHur commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implement Locale::canonicalize / parseLocale / composeLocale / getKeywords (and procedural aliases) in ext/intl/VmLocale.php with thin ICU uloc_* FFI + PHP fallbacks.
  • Register OOP methods + locale_* builtins; compliance test/compliance/cases/intl/locale_canonicalize_parse.phpt.
  • No new C runtime — PHP-in-PHP + existing FFI pattern.

php-src: ext/intl/locale/locale.stub.php, locale_methods.c

Closes #20738

Test plan

  • Issue repro PROFILE=8.4: methods present; canonicalize('en-US')en_US
  • vendor/bin/phpunit --filter locale_canonicalize_parse → OK (VM+JIT)
  • bootstrap-inventory --check OK 5818/5818; check-generated-docs OK

Trust snapshot

user_release_ready=no on master (spine-coverage / north-star5-fast red for NestedTernaryRejector.php) — pre-existing; this PR does not touch spine.

Made with Cursor

PurHur and others added 2 commits July 19, 2026 00:20
…0738)

Add the BCP-47 compose/parse/canonicalize/keyword surface beside existing
Locale helpers via ICU uloc_* FFI with PHP fallbacks (no new C runtime).

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur force-pushed the agent/ext-io-20738-locale-canonicalize branch from 1f21b6a to 2a0c204 Compare July 19, 2026 00:21
@PurHur
PurHur merged commit 1510ad5 into master Jul 19, 2026
@PurHur
PurHur deleted the agent/ext-io-20738-locale-canonicalize branch July 19, 2026 00:21
PurHur added a commit that referenced this pull request Jul 19, 2026
…0752) (#20759)

Restore spine-coverage / north-star5-fast after #20750 landed eight Locale helpers without compiler_lib_spine_smoke requires.

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur added a commit that referenced this pull request Jul 19, 2026
…#20761)

Restores Pillar 1 Trust (spine-coverage + north-star5-fast) after Locale
helpers landed without compiler_lib_spine_smoke requires.

Closes #20752

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
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::canonicalize()/parseLocale()/composeLocale()/getKeywords() missing after #6696/#20036 (ext/intl/locale)

1 participant