From:             raven990862 at gmail dot com
Operating system: Windows Vista
PHP version:      5.2.6
PHP Bug Type:     Arrays related
Bug description:  in_array returning true for values not in the array

Description:
------------
in_array is returning true for needles that are not in the haystack.

The problem is with with large needles that are similar except for 
least significant digits.

Yes, it does work correctly when you set strict to true in in_array,
however I would expect this to work correctly with out it.

Reproduce code:
---------------
<?php

$a =  array('999999999999999999');
if(in_array('999999999999999990',$a))
{
        echo "true";
}

?>

Expected result:
----------------
This should return nothing.


Actual result:
--------------
in_array returns true and the echo occurs.


-- 
Edit bug report at http://bugs.php.net/?id=45998&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=45998&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=45998&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=45998&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45998&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=45998&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45998&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45998&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45998&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45998&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45998&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=45998&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=45998&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45998&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45998&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45998&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45998&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45998&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45998&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45998&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45998&r=mysqlcfg

Reply via email to