Skip to content

Stdlib: resourcebundle_get_error_code()/resourcebundle_get_error_message() missing — OOP OK after #20739 (ext/intl/resourcebundle) #20853

Description

@PurHur

Category

stdlib · php-src-strict · ext/intl ResourceBundle procedural error aliases

Problem

After #6187 / #20739, OOP ResourceBundle::create() / get() / count() / getLocales() / getErrorCode() / getErrorMessage() work on VM (PROFILE=8.4), and procedurals resourcebundle_create / resourcebundle_get / resourcebundle_locales / resourcebundle_count are registered. php-src also exposes resourcebundle_get_error_code and resourcebundle_get_error_message, which remain undefined (same alias pattern as collator_get_error_* / msgfmt_get_error_* / numfmt_get_error_*).

Repro Zend (intl) VM PROFILE=8.4 (2026-07-19)
method_exists('ResourceBundle', 'getErrorCode') true true
function_exists('resourcebundle_create') / resourcebundle_count true true
function_exists('resourcebundle_get_error_code') true false
function_exists('resourcebundle_get_error_message') true false

php-src reference

PHP implementation target

  • Add ext/intl/resourcebundle_get_error_code.php + resourcebundle_get_error_message.php beside existing resourcebundle_*.php
  • Reuse VmResourceBundle / OOP error helpers — thin procedural wrappers only
  • Register in ext/intl/Module.php next to resourcebundle_count
  • No new C in runtime/; sync spine/inventory if new units added

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
cat > /tmp/rb_err_gap.php << "PHP"
<?php
echo "oop_err=" . (method_exists("ResourceBundle", "getErrorCode") ? "yes" : "no") . "\n";
foreach (["resourcebundle_create","resourcebundle_count","resourcebundle_get_error_code","resourcebundle_get_error_message"] as $f) {
  echo "$f=" . (function_exists($f) ? "yes" : "no") . "\n";
}
PHP
PHP_COMPILER_PROFILE=8.4 php bin/vm.php /tmp/rb_err_gap.php'

Observed (2026-07-19):

oop_err=yes
resourcebundle_create=yes
resourcebundle_count=yes
resourcebundle_get_error_code=no
resourcebundle_get_error_message=no

Done when

  • Procedurals match OOP getErrorCode / getErrorMessage / Zend
  • Compliance under test/compliance/cases/intl/; php-src-strict
  • No new C in runtime/; spine/inventory synced for new units

Activity

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 appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions