Bug #79262 [Opn->Nab]: Calling key() on ArrayObject returns nothing
| From: | requinix@php.net | Date: | Tue, 11 Feb 2020 23:21:06 +0000 |
| Subject: | Bug #79262 [Opn->Nab]: Calling key() on ArrayObject returns nothing | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-225515@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79262&edit=1
ID: 79262
Updated by: requinix@php.net
Reported by: alexander at sulu dot io
Summary: Calling key() on ArrayObject returns nothing
-Status: Open
+Status: Not a bug
Type: Bug
Package: Arrays related
Operating System: MACOS Mojave
PHP Version: 7.4.2
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
https://www.php.net/manual/en/migration74.incompatible.php#migration74.incompatible.spl
Previous Comments:
------------------------------------------------------------------------
[2020-02-11 23:13:30] alexander at sulu dot io
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 this bug report at https://bugs.php.net/bug.php?id=79262&edit=1