#33539 [Opn->Bgs]: array_search returns wrong value
| From: | derick@php.net | Date: | Sat, 02 Jul 2005 10:11:40 +0000 |
| Subject: | #33539 [Opn->Bgs]: array_search returns wrong value | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-81291@lists.php.net to get a copy of this message | ||
ID: 33539
Updated by: derick@php.net
Reported By: martin dot mohr at bytec dot de
-Status: Open
+Status: Bogus
Bug Type: Arrays related
Operating System: Linux 2.4.27
PHP Version: 4.3.11
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
http://no.php.net/array_search
Previous Comments:
------------------------------------------------------------------------
[2005-07-01 19:38:13] martin dot mohr at bytec dot de
Description:
------------
Using array_search with "haystack" completly numeric and the first 16
digits identic a wrong key is returned. This does not occur if one
character is in the "haystack" or if there is any difference in the
first 16 digits.
Reproduce code:
---------------
<?
$a = array (11 => "99999999999999999999999999",
57 => "11022625212002021111111111",
80 => "11022625212002021051765412");
print_r($a);
$b = array_search ("11022625212002021051765412", $a);
echo $b;
?>
Expected result:
----------------
Array ( [11] => 99999999999999999999999999 [57] =>
11022625212002021111111111 [80] => 11022625212002021051765412 ) 80
Actual result:
--------------
Array ( [11] => 99999999999999999999999999 [57] =>
11022625212002021111111111 [80] => 11022625212002021051765412 ) 57
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33539&edit=1