#45949 [NEW]: Why 0(int, NOT '0'- string) in any string array?
| From: | pengxin at itsail dot com | Date: | Fri, 29 Aug 2008 16:26:30 +0000 |
| Subject: | #45949 [NEW]: Why 0(int, NOT '0'- string) in any string array? | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-128534@lists.php.net to get a copy of this message | ||
From: pengxin at itsail dot com
Operating system: WinXP
PHP version: 5.2.6
PHP Bug Type: Arrays related
Bug description: Why 0(int, NOT '0'- string) in any string array?
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 bug report at http://bugs.php.net/?id=45949&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45949&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45949&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45949&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45949&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=45949&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45949&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45949&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45949&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45949&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45949&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=45949&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=45949&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45949&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45949&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45949&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45949&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45949&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45949&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45949&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45949&r=mysqlcfg