Skip to content

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

Closed

Description

@PurHur

Category

stdlib · php-src-strict · PHP 8.4 forward-profile registration

Problem

locale_get_primary_language(), locale_get_region(), and locale_get_script() are implemented under ext/intl/ and were marked done in #5125, but on the default 8.4.0-dev toolchain (no PHP_COMPILER_PROFILE) they are not registered. Workers must set PHP_COMPILER_PROFILE=8.4 to reach them. Zend with ext/intl loaded exposes the parsers on the reference host.

Repro Zend 8.2+ (intl loaded) VM (2026-07-07, default)
function_exists('locale_get_primary_language') true false
locale_get_primary_language('en_US_POSIX') 'en' fatal: not registered
same with PHP_COMPILER_PROFILE=8.4 n/a (Zend ignores) 'en'

php-src reference

PHP implementation target

Repro

./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_locale_get_primary_language.php'
# fail: locale_get_primary_language not registered

./script/docker-exec.sh -- bash -lc 'PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/maintainer_gap_locale_get_primary_language.php'
# ok

Done when

Activity

  1. added
    bugSomething isn't working
    enhancementNew feature or request
    phase-4:stdlibPhase 4 – stdlib for web apps
    area:vmVirtual machine
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Jul 7, 2026
  2. PurHur commented on Jul 7, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib — starting this run

  3. PurHur commented on Jul 7, 2026

    @PurHur
    OwnerAuthor

    Merged via PR #17128.

    Root cause: advertisesLocaleParserForwardProfile() used advertisesGraphemeStrContains() which compares raw VERSION (8.4.0-dev) against 8.4.0 (false), while supportsLocaleParserForwardProfile() correctly uses builtinAdvertisementVersion() (returns 8.4.0 on the dev line). Functions were registered but function_exists() returned false.

    Fix: advertisesLocaleParserForwardProfile() now delegates to supportsLocaleParserForwardProfile().

    Verification:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machinebugSomething isn't workingenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions