Bug in array_search()

From: Date: Sun, 03 Feb 2002 19:24:45 +0000
Subject: Bug in array_search()
Groups: php.dev 
Request: Send a blank email to php-dev+get-78977@lists.php.net to get a copy of this message
array_search() always returns true when one of the array's values is 'true': <?php $array = array('foo' => true); if (array_search('this', $array) !== false) { echo 'is this a bug?'; } ?> Setting the third, optional parameter to true solves this problem, but I doubt that this is the intended behaviour... -- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/

« previous php.dev (#78977) next »