Skip to content

Stdlib: ResourceBundle getLocales/getErrorCode/getErrorMessage/getIterator (#20739) - #20775

Merged
PurHur merged 1 commit into
masterfrom
agent/stdlib-20739-resourcebundle-locales-errors
Jul 19, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/stdlib-20739-resourcebundle-locales-errors

Conversation

@PurHur

@PurHur PurHur commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #20739

php-src reference

  • ext/intl/resourcebundle/resourcebundle_class.cpp — resourcebundle_locales / resourcebundle_get_error_* / getIterator
  • ext/intl/resourcebundle/resourcebundle.stub.php

PHP implementation

  • ext/intl/VmResourceBundle.php (+ IntlError::U_MISSING_RESOURCE_ERROR)
  • No new C runtime

Test plan

  • PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/issue_20739_resourcebundle_locales_errors.php
  • PHP_COMPILER_PROFILE=8.4 php bin/compile.php -l test/repro/issue_20739_resourcebundle_locales_errors.php
  • vendor/bin/phpunit --filter resourcebundle_locales_errors (VM green; JIT skipped WeakRefNativeOpsJit bootstrap)
  • Full AOT phpc build of ResourceBundle instance methods — pre-existing gap ($rb->get() already undefined method object::get() under AOT; FFI unavailable in native binary for locales enum)

Verification transcript (this workspace)

getLocales=1
locales_ok=1
has_en=1
err0=0|U_ZERO_ERROR
missing=NULL
err1=2|Cannot load resource element '___missing_key_zzz___': U_MISSING_RESOURCE_ERROR
iterator_ok=1
LINT_OK

Pillar 1 before claim: bootstrap-selfhost-link OK; inventory OK 5826/5826; user_release_ready: yes.

Made with Cursor

…rator (#20739)

Expose remaining ResourceBundle surface via ICU ures_openAvailableLocales FFI and per-object error state matching php-src resourcebundle_class.cpp; missing get() returns null with U_MISSING_RESOURCE_ERROR.

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: ResourceBundle::getLocales()/getErrorCode()/getErrorMessage() missing after #6187 (ext/intl/resourcebundle)

1 participant