Category
bug · php-src-strict · ResourceBundle construct failure
Problem
When the ICU bundle/locale cannot be loaded and $fallback is false, Zend returns null and sets intl_get_error_code() to U_MISSING_RESOURCE_ERROR (2). VM returns an empty ResourceBundle object with intl_get_error_code()===0. Distinct from #22854 (fallback locale U_USING_DEFAULT_WARNING).
Repro (ResourceBundle::create($loc, $bundle, false)) |
Zend 8.2+ |
VM (2026-07-24) |
xx_YY / ICUDATA-zone |
NULL, err=2 (U_MISSING_RESOURCE_ERROR) |
ResourceBundle object, err=0 |
zz_ZZ / ICUDATA |
NULL, err=2 |
object, err=0 |
en / no_such_bundle_xyz |
NULL, err=2 |
non-object / inconsistent |
php-src reference
PHP implementation target
ext/intl/ ResourceBundle create path (VmResourceBundle / construct helper) — on open failure with $fallback=false, return null, set intl error code/message like Zend; do not publish empty object
- PHP-in-PHP; no new C
Repro
./script/docker-exec.sh -- bash -lc 'cat >/tmp/rb_missing.php <<'"'"'PHP'"'"'
<?php
$r = @ResourceBundle::create("xx_YY", "ICUDATA-zone", false);
echo $r === null ? "NULL" : ("OBJ:".get_class($r));
echo " err=", intl_get_error_code(), " msg=", intl_get_error_message(), "\n";
PHP
php /tmp/rb_missing.php
php bin/vm.php /tmp/rb_missing.php'
Done when
Category
bug· php-src-strict · ResourceBundle construct failureProblem
When the ICU bundle/locale cannot be loaded and
$fallbackisfalse, Zend returnsnulland setsintl_get_error_code()toU_MISSING_RESOURCE_ERROR(2). VM returns an emptyResourceBundleobject withintl_get_error_code()===0. Distinct from #22854 (fallback localeU_USING_DEFAULT_WARNING).ResourceBundle::create($loc, $bundle, false))xx_YY/ICUDATA-zoneNULL, err=2(U_MISSING_RESOURCE_ERROR)ResourceBundleobject, err=0zz_ZZ/ICUDATANULL, err=20en/no_such_bundle_xyzNULL, err=2php-src reference
ext/intl/resourcebundle/resourcebundle_class.c—resourcebundle_ctorfailure →NULL+ intl errorures_open/U_MISSING_RESOURCE_ERRORPHP implementation target
ext/intl/ResourceBundle create path (VmResourceBundle / construct helper) — on open failure with$fallback=false, returnnull, set intl error code/message like Zend; do not publish empty objectRepro
Done when
$fallback=false→null+U_MISSING_RESOURCE_ERROR(msg contains resourcebundle_ctor / missing resource).phpt; php-src-strict