#20765 [Opn->Bgs]: problem with array_search function
| From: | philip@php.net | Date: | Mon, 02 Dec 2002 17:21:57 +0000 |
| Subject: | #20765 [Opn->Bgs]: problem with array_search function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-26405@lists.php.net to get a copy of this message | ||
ID: 20765
Updated by: philip@php.net
Reported By: lenny@solbridge.com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Windows XP
PHP Version: 4.2.3
New Comment:
There is a warning in the docs, I'll quote it here:
This function may return Boolean FALSE, but may also return a
non-Boolean value which evaluates to FALSE, such as 0 or "". Please
read the section on Booleans for more information. Use the === operator
for testing the return value of this function.
This comes from the &return.falseproblem; entity in the docs.
Previous Comments:
------------------------------------------------------------------------
[2002-12-02 11:10:15] lenny@solbridge.com
array_search will return "THE POSITION of the NEEDLE" when a needle is
found in an array and return "FALSE" when not found. The problem will
occur when the NEEDLE is found to be at the first position of an array
which will return a "0", a value that is equipvalent to "FALSE" though
the NEEDLE has been successfully found.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=20765&edit=1