|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79262 Calling key() on ArrayObject returns nothing
Submitted: 2020-02-11 23:13 UTC Modified: 2020-02-11 23:21 UTC
From: alexander at sulu dot io Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 7.4.2 OS: MACOS Mojave
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: alexander at sulu dot io
New email:
PHP Version: OS:


 [2020-02-11 23:13 UTC] alexander at sulu dot io
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`
       new \ArrayObject(["test" => "123"])


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-02-11 23:21 UTC]
-Status: Open +Status: Not a bug
 [2020-02-11 23:21 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Sep 18 17:01:53 2020 UTC