Doc #71713 [Com]: Array_Key_exist is not recursive

From: Date: Sat, 05 Mar 2016 19:28:52 +0000
Subject: Doc #71713 [Com]: Array_Key_exist is not recursive
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-13232@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 Comment by: martin at wenhaston dot net Reported by: martin at wenhaston dot net Summary: Array_Key_exist is not recursive Status: Open Type: Documentation Problem Package: Arrays related Operating System: N/A PHP Version: Irrelevant Block user comment: N Private report: N New Comment: While that may be so, I am asking that the documentation clarifies this point. Previous Comments: ------------------------------------------------------------------------ [2016-03-05 18:04:18] 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-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

« previous php.doc.bugs (#13232) next »