php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #71713 Array_Key_exist is not recursive
Submitted: 2016-03-04 19:01 UTC Modified: 2016-09-28 13:31 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: martin at wenhaston dot net Assigned: cmb (profile)
Status: Closed Package: Arrays related
PHP Version: Irrelevant OS: N/A
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: martin at wenhaston dot net
New email:
PHP Version: OS:

 

 [2016-03-04 19:01 UTC] martin at wenhaston dot net
Description:
------------
The manual page for array_key_exists does not state in any form that array_key_exists DOES NOT WORK on multidimensional arrays. 

http://php.net/array_key_exists

Test script:
---------------
$array = ("horse","tree","card");
$array['guard']['dog'] = "wOOF";
if (array_key_exists("dog",$array)){
    print "found!";
}
else {
    print "Dog not found!";
}

// Never finds array key dog. Only searches first level of array. 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-03-05 18:04 UTC] cmb@php.net
-Package: Documentation problem +Package: Arrays related
 [2016-03-05 18:04 UTC] cmb@php.net
Well, PHP doesn't have multidimensional arrays; it's just that an
array value can be an array. However, that doesn't mean that a key
that exists in such an inner array belongs to the outer array.
Therefore the documentation is not in error, in my opinion.
 [2016-03-05 19:28 UTC] martin at wenhaston dot net
While that may be so, I am asking that the documentation clarifies this point.
 [2016-09-28 13:27 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=340229
Log: Fix #71713: Array_Key_exist is not recursive

Provided by Nikolay Labinskiy.
 [2016-09-28 13:31 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2016-09-28 13:31 UTC] cmb@php.net
Okay, I guess a respective note can't hurt, and there are other
parts of the manual mentioning multidimensional arrays, so:

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2020-02-07 06:06 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=ea367db0158597017d7ff9dcc1ea4621d95f5f6e
Log: Fix #71713: Array_Key_exist is not recursive
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 19:01:28 2024 UTC