Skip to content

Stdlib: Locale::canonicalize()/locale_canonicalize() AOT returns null stub (ext/intl, follow-up #20738) #20760

Description

@PurHur

Category

stdlib · php-src-strict · ext/intl Locale · pillar 4 · AOT

Problem

#20738 shipped VM/JIT compliance for Locale::canonicalize / parseLocale / composeLocale / getKeywords, but user-script AOT still hits JIT\Call\ExternalMethod for locale::canonicalize (null stub) and locale_canonicalize() throws JIT lowering not implemented.

Repro Zend VM AOT (master after #20750)
Locale::canonicalize('en-US') en_US en_US empty/null stub
locale_canonicalize('en-US') en_US en_US compile fails (RuntimeException)

php-src reference

Done when

  • Locale::canonicalize('en-US') and locale_canonicalize('en-US') → en_US under php bin/compile.php -o … && ./binary (PROFILE=8.4)
  • No new C runtime — extend LocaleParserJitHelper / JitLocaleParser + register locale::canonicalize proxy
  • Compliance / shrink test still green

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
export PHP_COMPILER_PROFILE=8.4 PHP_COMPILER_HELPER_RUNTIME_O=0
php bin/compile.php -o /tmp/c test/repro/issue_XXXX_locale_canonicalize_aot.php && /tmp/c'

Activity

  1. added
    bugSomething isn't working
    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 19, 2026
  2. PurHur commented on Jul 19, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib — starting this run (AOT canonicalize lowering follow-up #20738)

    Trust probe: make bootstrap-selfhost-link OK earlier; inventory OK; user_release_ready: no (spine NestedTernaryRejector — pre-existing, now may be green after #20751).

  3. PurHur commented on Jul 19, 2026

    @PurHur
    OwnerAuthor

    Merged #20762 (squash).

    Verification:

    • AOT: PHP_COMPILER_PROFILE=8.4 PHP_COMPILER_HELPER_RUNTIME_O=0 php bin/compile.php -o /tmp/r test/repro/issue_20760_locale_canonicalize_aot.php && /tmp/r → canon=en_US / proc=en_US / ok (exit 0)
    • vendor/bin/phpunit --filter "locale_canonicalize_parse|LocaleParserRuntimeShrink" → OK (5 tests)
    • inventory OK 5818/5818; check-generated-docs OK

    php-src: ext/intl/locale/locale_methods.c — PHP-in-PHP via LocaleParserJitHelper::canonicalizeArgv + locale::canonicalize JIT proxy (no new C).

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 workingimplementation-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