Bug #80644 [NEW]: Missing resource causes subsequent get() calls to fail
| From: | rdueck at mcmillan-mcgee dot com | Date: | Mon, 18 Jan 2021 22:18:24 +0000 |
| Subject: | Bug #80644 [NEW]: Missing resource causes subsequent get() calls to fail | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-231624@lists.php.net to get a copy of this message | ||
From: rdueck at mcmillan-mcgee dot com
Operating system: Ubuntu 16.04.7 LTS
PHP version: 8.0.1
Package: *Languages/Translation
Bug Type: Bug
Bug description:Missing resource causes subsequent get() calls to fail
Description:
------------
Upgrading from 7.4.14 to 8.0.1 changes the behaviour of
ResourceBundle::get($index). If a non-existent $index is requested,
get($index) returns null, and all subsequent calls to get() also return
null, even for $index values that exist.
Test script:
---------------
<?php
file_put_contents('en.txt','en { "exists" {"found"} }');
shell_exec('genrb en.txt');
$r = new ResourceBundle('en.res', __DIR__);
$r->get('does_not_exist');
if($r->get('exists') === null) echo "Error\n";
else echo "Ok\n";
// cleanup
unlink('en.txt');
unlink('en.res');
Expected result:
----------------
Ok
Actual result:
--------------
Error
--
Edit bug report at https://bugs.php.net/bug.php?id=80644&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80644&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80644&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80644&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80644&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80644&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80644&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80644&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80644&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80644&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80644&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80644&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80644&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80644&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80644&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80644&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80644&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80644&r=mysqlcfg