Bug #18259 Updated: array_search doesnt search in arrayindex[0]

From: Date: Wed, 10 Jul 2002 10:02:14 +0000
Subject: Bug #18259 Updated: array_search doesnt search in arrayindex[0]
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-13705@lists.php.net to get a copy of this message
ID: 18259 Updated by: sander@php.net Reported By: schizo@psykick.de -Status: Open +Status: Bogus Bug Type: Arrays related Operating System: Windows2000 PHP Version: 4.2.1 New Comment: It doesn't return false, it returns 0 (because the value you're looking for has index 0). 0 evaluates to false. Use array_search(...) === false. Previous Comments: ------------------------------------------------------------------------ [2002-07-10 05:13:00] schizo@psykick.de array_search doesnt search the first index (0) of an array. example: url: test.php?action=new&state=ok&module=1 test.php: ... $page_params=array_merge($HTTP_POST_VARS,$HTTP_GET_VARS); //merge is not the problem array_search("state",array_keys($page_params)); //result: true -> its ok array_search("action",array_keys($page_params)); //result: false -> BUG array_keys() works correct (I checked this), the problem is the array_search(). ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18259&edit=1

« previous php.bugs (#13705) next »