Doc #71713 [Opn]: Array_Key_exist is not recursive
| From: | cmb@php.net | Date: | Sat, 05 Mar 2016 18:04:19 +0000 |
| Subject: | Doc #71713 [Opn]: Array_Key_exist is not recursive | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-13231@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71713&edit=1
ID: 71713
Updated by: cmb@php.net
Reported by: martin at wenhaston dot net
Summary: Array_Key_exist is not recursive
Status: Open
Type: Documentation Problem
-Package: Documentation problem
+Package: Arrays related
Operating System: N/A
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2016-03-04 19:01:06] 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.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71713&edit=1