Skip to content

Stdlib: advertise locale BCP-47 parsers on default 8.4.0-dev profile (#17117) - #17128

Merged
PurHur merged 3 commits into
masterfrom
agent/issue-17117-locale-parser-default-profile
Jul 7, 2026
Merged

PurHur merged 3 commits into
masterfrom
agent/issue-17117-locale-parser-default-profile

Conversation

@PurHur

@PurHur PurHur commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Align advertisesLocaleParserForwardProfile() with supportsLocaleParserForwardProfile() so locale_get_primary_language/region/script are visible to function_exists() on the default 8.4.0-dev line without PHP_COMPILER_PROFILE=8.4.
  • Functions were already registered via IntlExtensionPolicy::profileLocaleParserFunctions(); only the advertisement gate was stale (advertisesGraphemeStrContains() used version_compare('8.4.0-dev','8.4.0','>=') which is false).
  • php-src reference: ext/intl/locale/locale_methods.c

Root cause

supportsLocaleParserForwardProfile() correctly uses builtinAdvertisementVersion() (returns 8.4.0 on the dev line), but advertisesLocaleParserForwardProfile() delegated to advertisesGraphemeStrContains() which compares raw VERSION (8.4.0-dev) against 8.4.0.

Verification

# VM repro (was: fail: locale_get_primary_language not registered)
php bin/vm.php test/repro/maintainer_gap_locale_get_primary_language.php
# ok

# Compliance
php bin/vm.php test/compliance/cases/stdlib/locale_get_parts.phpt
# en / US / Hans / en / (blank) / zh / CN

# Unit tests
php -d memory_limit=1536M vendor/bin/phpunit --filter IntlExtensionPolicyTest
# OK (3 tests, 29 assertions)

# AOT compile-only (runtime JIT deferred per #5125)
php bin/compile.php -l test/fixtures/aot/compile-only/locale_get_parts.php
# COMPILE_ONLY_OK

Closes #17117

Made with Cursor

PurHur and others added 3 commits July 7, 2026 04:01
Wire hash_init/update/final/copy through JitHashContext with HashContext
object property buffering and JitHash::hash for finalize. Fix
StringHashCryptoPhp bridge i32→i1 coercion for AOT module verify.

VM + AOT compile verified; AOT execute still under investigation when
update/final are linked in the same binary (startup segfault in Docker).

php-src: ext/hash/hash.c
Co-authored-by: Cursor <cursoragent@cursor.com>
Store __hcAlgo/__hcData/__hcLive on HashContext as native string property
slots (not TYPE_VALUE boxes) so propertyFetch round-trips for hash_final().
Deep-copy strings in hash_copy(); defer StringHashCrypto link to hash_final.

VM/JIT repro green; AOT execute still empty output (follow-up on #3357).

Co-authored-by: Cursor <cursoragent@cursor.com>
…17117)

Align advertisesLocaleParserForwardProfile() with supportsLocaleParserForwardProfile()
so locale_get_primary_language/region/script are visible to function_exists() on the
8.4.0-dev line without PHP_COMPILER_PROFILE=8.4.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 9400aa5 into master Jul 7, 2026
@PurHur
PurHur deleted the agent/issue-17117-locale-parser-default-profile branch July 7, 2026 06:10
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.

Regression: locale_get_primary_language/region/script gated off default 8.4.0-dev profile (re-#5125, ext/intl/locale)

1 participant