ID:               49657
 User updated by:  pvenakis at efrontlearning dot net
 Reported By:      pvenakis at efrontlearning dot net
 Status:           Bogus
 Bug Type:         Unknown/Other Function
 Operating System: windows
 PHP Version:      5.3.0
 New Comment:

Thanks for the quick response. It's fine that it returns null, but
since this changed from 5.2 to 5.3 it would be nice if it were mentioned
in the changelog or in the documents. 
Best Regards, Periklis


Previous Comments:
------------------------------------------------------------------------

[2009-09-24 12:17:22] [email protected]

That's expected. Returning NULL on invalid argument(s) is correct.

------------------------------------------------------------------------

[2009-09-24 12:03:47] pvenakis at efrontlearning dot net

Description:
------------
array_search returns false in 5.2.x, null in 5.3.0, when $haystack is
not an array


Reproduce code:
---------------
$haystack = false; //Anything not an array
$result = array_search(1, $haystack);
var_dump($result);


Expected result:
----------------
bool(false)

Actual result:
--------------
null


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=49657&edit=1

Reply via email to