#45949 [Opn->Bgs]: Why 0(int, NOT '0'- string) in any string array?
| From: | felipe@php.net | Date: | Fri, 29 Aug 2008 16:36:06 +0000 |
| Subject: | #45949 [Opn->Bgs]: Why 0(int, NOT '0'- string) in any string array? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-128535@lists.php.net to get a copy of this message | ||
ID: 45949
Updated by: felipe@php.net
Reported By: pengxin at itsail dot com
-Status: Open
+Status: Bogus
Bug Type: Arrays related
Operating System: WinXP
PHP Version: 5.2.6
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
Use the third parameter.
http://docs.php.net/in-array
Previous Comments:
------------------------------------------------------------------------
[2008-08-29 16:26:30] pengxin at itsail dot com
Description:
------------
Well. why 0(it's int, NOT '0' with string) in any string array? I think
it shouldn't be.
Reproduce code:
---------------
<?php
if (in_array(0, array('All'))) {
echo 'a';
} else {
echo 'b';
}
?>
Expected result:
----------------
it outputs "b", and I think it should be "a". Because 0 and "0" are
different.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45949&edit=1