|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-03-06 04:37 UTC] laruence@php.net
[2013-03-06 04:37 UTC] laruence@php.net
-Type: Bug
+Type: Feature/Change Request
[2021-11-11 11:16 UTC] nikic@php.net
-Package: intl
+Package: I18N and L10N related
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 20:00:01 2025 UTC |
Description: ------------ Even though \ResourceBundle provides array access, it does not implement the \ArrayAccess interface nor allows to call isset() on its entries. The following resource is necessary for the below test script: en.txt: --------------- en{ Exists{"value"} } You need to convert this file to a .res file and place it in the same directory as the test script: > genrb en.txt Test script: --------------- <?php $bundle = new \ResourceBundle('en', __DIR__); var_dump($bundle instanceof \ArrayAccess); var_dump($bundle['Exists']); var_dump($bundle['ExistsNot']); var_dump(isset($bundle['ExistsNot'])); Expected result: ---------------- bool(true) string(5) "value" NULL bool(false) Actual result: -------------- bool(false) string(5) "value" NULL Fatal error: Cannot use object of type ResourceBundle as array in test.php on line 8 Call Stack: 0.0002 128452 1. {main}() test.php:0