#40247 [Opn->Bgs]: array_merge + array_search gives wrong result
| From: | tony2001@php.net | Date: | Fri, 26 Jan 2007 10:14:33 +0000 |
| Subject: | #40247 [Opn->Bgs]: array_merge + array_search gives wrong result | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-108087@lists.php.net to get a copy of this message | ||
ID: 40247
Updated by: tony2001@php.net
Reported By: y1ngf4n at hotmail dot com
-Status: Open
+Status: Bogus
Bug Type: Arrays related
Operating System: Windows XP
PHP Version: 5.2.0
New Comment:
(int)0 == (int)'b'
That's why the last argument of array_search() is there.
"If the optional third parameter strict is set to TRUE then the
array_search() will also check the types of the needle in the
haystack."
Previous Comments:
------------------------------------------------------------------------
[2007-01-26 10:06:11] y1ngf4n at hotmail dot com
Description:
------------
seems like a very unique case,
since array_merge(range('a','z'),range('0','9')) will
produce correct
result
Reproduce code:
---------------
$test = array_merge(range('0','9'),range('a','z'));
var_dump(array_search('b',$test));
Expected result:
----------------
11
Actual result:
--------------
0
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40247&edit=1