Edit report at https://bugs.php.net/bug.php?id=64129&edit=1

 ID:                 64129
 Updated by:         ras...@php.net
 Reported by:        email dot fivemin at gmail dot com
 Summary:            bug in in_array
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            *General Issues
 Operating System:   All
 PHP Version:        5.3.3
 Block user comment: N
 Private report:     N

 New Comment:

You want:
in_array(0,$v,true);
then. The code is behaving correctly because you are doing a non-strict search 
and you have and empty element which will match 0 with a non-strict match.


Previous Comments:
------------------------------------------------------------------------
[2013-02-01 19:10:23] email dot fivemin at gmail dot com

edit

------------------------------------------------------------------------
[2013-02-01 19:05:11] email dot fivemin at gmail dot com

Description:
------------
this code return 1
i have null member and null isn't zero!
<?
$t="1,2,";
$v=explode(",",$t);
print_r($v);
echo in_array(0,$v);
echo "\n";
?>

Test script:
---------------
<?
$t="1,2,";
$v=explode(",",$t);
print_r($v);
echo in_array(0,$v);
echo "\n";
?>

Expected result:
----------------
in_array function return 0



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64129&edit=1

Reply via email to