Bug #61776 [Opn->Nab]: $var = ''; var_dump(in_array($var, array(0,1)))// boolean true
| From: | felipe@php.net | Date: | Thu, 19 Apr 2012 22:27:54 +0000 |
| Subject: | Bug #61776 [Opn->Nab]: $var = ''; var_dump(in_array($var, array(0,1)))// boolean true | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-169748@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=61776&edit=1
ID: 61776
Updated by: felipe@php.net
Reported by: aestur at me dot com
Summary: $var = ''; var_dump(in_array($var, array(0,1)))//
boolean true
-Status: Open
+Status: Not a bug
Type: Bug
Package: PHP options/info functions
Operating System: windows
PHP Version: 5.3.10
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
See the third argument of in_array() function.
http://docs.php.net/in-array
Previous Comments:
------------------------------------------------------------------------
[2012-04-19 18:00:23] aestur at me dot com
the php version is 5.3.8 on windows seven
------------------------------------------------------------------------
[2012-04-19 17:59:20] aestur at me dot com
Description:
------------
$var = '';
var_dump(in_array($var, array(0,1)))// boolean true
Some weird cast is performed.
Test script:
---------------
$var = '';
var_dump(in_array($var, array(0,1)));
Expected result:
----------------
false
Actual result:
--------------
true
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61776&edit=1