ID:               26232
 Updated by:       [EMAIL PROTECTED]
 Reported By:      me at my dot house
-Status:           Open
+Status:           Verified
-Bug Type:         Performance problem
+Bug Type:         Arrays related
-Operating System: Debian
+Operating System: *
-PHP Version:      4.3.2
+PHP Version:      4.3.2, 5b2
 New Comment:

[EMAIL PROTECTED] /usr/src/php5 $ php -r
'var_dump(in_array("x",array(1,2,3,false)));'
bool(false)
[EMAIL PROTECTED] /usr/src/php5 $ php -r
'var_dump(in_array("x",array(1,2,3,true)));'
bool(true)


Previous Comments:
------------------------------------------------------------------------

[2003-11-12 22:11:00] me at my dot house

Description:
------------
If the haystack contains the boolean true, in_array returns true!!
Check this (PHP 4.2.3-8 debian package) :



Reproduce code:
---------------
<?php
$r=array("fzsgsdgsd","reazrazr","rezarzearzae",true);
$ret=in_array("tsuser_id",$r);

print $ret;

}

?> 

Expected result:
----------------
false

Actual result:
--------------
true


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


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

Reply via email to