ID: 48986 Updated by: fel...@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