Skip to content

Stdlib: ResourceBundle — ext/intl ICU message bundle API missing (ext/intl/resourcebundle) #6187

Closed

Description

@PurHur

Category

stdlib

Problem

Zend ext/intl registers ResourceBundle for ICU .res / locale data lookup (get, count, getErrorCode, …). This compiler's ext/intl/BuiltinClasses.php skeleton only registers IntlDateFormatter, Collator, and IntlException (#5774). class_exists('ResourceBundle') is false and any user code constructing bundles fatals.

php-src reference

  • ext/intl/resourcebundle/resourcebundle_class.c — ResourceBundle methods
  • ext/intl/resourcebundle/resourcebundle_iterator.c — ResourceBundleIterator
  • ext/intl/php_intl.c — intl_register_class_ResourceBundle

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "var_export(class_exists(\"ResourceBundle\"));"
'

Observed: false

Zend with ext/intl enabled:

<?php
$rb = ResourceBundle::create('en', null);
var_export($rb->get('Version'));

Scope (this repo)

  • ext/intl/ResourceBundle.php (+ iterator) — VM class entry with methods mirroring php-src arginfo
  • Register in ext/intl/BuiltinClasses.php / ext/intl/Module.php
  • ICU via thin FFI only where PHP cannot reach ICU; prefer PHP algorithms for simple fallbacks documented in PR
  • Enum-case string operands → TypeError (php-src-strict)

Done when

  • class_exists('ResourceBundle') true on VM
  • ResourceBundle::create('en', null) returns object; get('Version') returns non-false string on VM
  • test/compliance/cases/stdlib/resourcebundle_en_version.phpt green
  • No permanent logic added to lib/AOT/runtime/*.c

Related: #3336 (intl umbrella), #6171 (IntlChar/UConverter/Spoofchecker), #5747 (Collator).

Activity

  1. added
    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 Jun 5, 2026
  2. PurHur commented on Jul 16, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib Advanced — batch (issues #6366, #6139, #6187) — queued after #6139

  3. PurHur commented on Jul 16, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib Advanced — batch (#6366+#6139 done) — starting #6187 ResourceBundle

  4. PurHur commented on Jul 16, 2026

    @PurHur
    OwnerAuthor

    Merged: #19720

    Verification

    • php test/repro/issue_6187_resourcebundle.php → true / obj / version_ok / 40 (ICU ures via libicuuc)
    • force-register unit + phantom OK; inventory/spine OK

    Batch complete this run: #6366 → #6139 → #6187 (3 merged).

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 machineenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web apps

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions