ID:               49167
 Updated by:       j...@php.net
 Reported By:      dos at null-squad dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Arrays related
 Operating System: CentOS
 PHP Version:      5.3.0
 New Comment:

It's same as this: "a" == true. Which you fix with "a" === true.
Use the 3rd param, Luke. RTFM: http://php.net/in_array


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

[2009-08-05 07:43:08] dos at null-squad dot com

Description:
------------
in_array() returns true for in_array('a', array('a'=>true)) instead of

false.

Reproduce code:
---------------
var_dump(
    in_array(
        'a',
        array('a'=>true)
    )
);

Expected result:
----------------
bool(false)

Actual result:
--------------
bool(true)


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


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

Reply via email to