#30036 [Opn->Bgs]: In_Array not works when array contain booleans
| From: | sniper@php.net | Date: | Wed, 15 Sep 2004 08:57:02 +0000 |
| Subject: | #30036 [Opn->Bgs]: In_Array not works when array contain booleans | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-66195@lists.php.net to get a copy of this message | ||
ID: 30036
Updated by: sniper@php.net
Reported By: marek at lewczuk dot com
-Status: Open
+Status: Bogus
Bug Type: Arrays related
Operating System: Windows
PHP Version: 4.3.8
New Comment:
Use the 3rd optional parameter (for strict search) which makes
in_array() to check the type too. NOT a bug.
Previous Comments:
------------------------------------------------------------------------
[2004-09-09 10:04:27] marek at lewczuk dot com
Description:
------------
When you have an array with boolean values, then in_array will always
return true.
Reproduce code:
---------------
print in_array("test it", array(true, true, "sdsd" => true))
Expected result:
----------------
should return false
Actual result:
--------------
true
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30036&edit=1