Bug #79262 [NEW]: Calling key() on ArrayObject returns nothing
| From: | alexander at sulu dot io | Date: | Tue, 11 Feb 2020 23:13:30 +0000 |
| Subject: | Bug #79262 [NEW]: Calling key() on ArrayObject returns nothing | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-225513@lists.php.net to get a copy of this message | ||
From: alexander at sulu dot io
Operating system: MACOS Mojave
PHP version: 7.4.2
Package: Arrays related
Bug Type: Bug
Bug description:Calling key() on ArrayObject returns nothing
Description:
------------
I updated a library which did use \ArrayObject and access its key with
the key function. I tested the script with both 7.4.0 and current 7.4.2
the result of the
key() call on \ArrayObject does return in 7.4 always
null instead on 7.3 it returns successfully the key. For me it looks
like all array functions has no effect on the \ArrayObject.
Test script:
---------------
// should return string(4) "test" will return instead NULL
var_dump(
key(
new \ArrayObject(["test" => "123"])
)
);
--
Edit bug report at https://bugs.php.net/bug.php?id=79262&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79262&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79262&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79262&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79262&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79262&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79262&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79262&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79262&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79262&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79262&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79262&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79262&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79262&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79262&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79262&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79262&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79262&r=mysqlcfg