#48986 [Opn->Bgs]: incorrect return values

From: Date: Mon, 20 Jul 2009 13:58:47 +0000
Subject: #48986 [Opn->Bgs]: incorrect return values
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-139967@lists.php.net to get a copy of this message
ID: 48986 Updated by: felipe@php.net Reported By: bansalcooldheeraj at gmail dot com -Status: Open +Status: Bogus -Bug Type: Unknown/Other Function +Bug Type: Arrays related Operating System: ubuntu PHP Version: 5.2.10 New Comment: It's not a bug. Read the warning section in the "Return value" part of this the doc. page. Previous Comments: ------------------------------------------------------------------------ [2009-07-20 13:53:08] bansalcooldheeraj at gmail dot com Description: ------------ array_search() has a bug as it may return 0 if it doesn't find the value but 0 is also a valid index in an array and if element is present at index 0 then also it should return 0 so this way how one can identify whether returned 0 is for not able to find or it is at index 0. Reproduce code: --------------- http://www.php.net/manual/en/function.array-search.php Expected result: ---------------- Please refer description Actual result: -------------- Please refer description ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48986&edit=1

« previous php.bugs (#139967) next »