Bug #16130: array_search does not return FALSE as documented
| From: | mccarthy36 at earthlink dot net | Date: | Mon, 18 Mar 2002 02:08:17 +0000 |
| Subject: | Bug #16130: array_search does not return FALSE as documented | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-2721@lists.php.net to get a copy of this message | ||
From: mccarthy36@earthlink.net
Operating system: Linux 2.4.12 / 2.4.17
PHP version: 4.1.2
PHP Bug Type: Arrays related
Bug description: array_search does not return FALSE as documented
I am calling array_search. I expect it to return FALSE if the needle value
is not in the haystack (as documented) -- it's not happening.
I searched the bug database and found this bug (#13567) reported for v.
4.0.5 and marked as closed, but the bug is still present in 4.1.2.
Script that demonstrates the problem:
$result = array_search( "M", array( "A", "Z" ) );
if ( $result === false ) {
echo "REALLY FALSE";
}
else {
echo "SOMETHING ELSE";
}
I expect the script to output "REALLY FALSE", instead it outputs
"SOMETHING ELSE".
Thanks.
--
Edit bug report at http://bugs.php.net/?id=16130&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=16130&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=16130&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=16130&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=16130&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16130&r=support
Expected behavior: http://bugs.php.net/fix.php?id=16130&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=16130&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=16130&r=submittedtwice