Bug #70466 [NEW]: in_array("a", array(0, 1) does not work properly
| From: | besciualexandru at gmail dot com | Date: | Wed, 09 Sep 2015 02:23:34 +0000 |
| Subject: | Bug #70466 [NEW]: in_array("a", array(0, 1) does not work properly | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-195896@lists.php.net to get a copy of this message | ||
From: besciualexandru at gmail dot com
Operating system: CENTOS 5
PHP version: Next Minor Version
Package: Arrays related
Bug Type: Bug
Bug description:in_array("a", array(0, 1) does not work properly
Description:
------------
---
From manual page: http://www.php.net/function.in-array
---
The script bellow does not behave properly. Only if you put '0' and '1'
as strings it behaves correctly.
Test script:
---------------
if (in_array("a", array(0, 1) )===true){
echo "'a' is inside array(0,1)";
} else {
echo "'a' is NOT inside array(0,1)";
}
Expected result:
----------------
'a' is NOT inside array(0,1)
Actual result:
--------------
'a' is inside array(0,1)
--
Edit bug report at https://bugs.php.net/bug.php?id=70466&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70466&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70466&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70466&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70466&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70466&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70466&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70466&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70466&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70466&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70466&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70466&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70466&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70466&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70466&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70466&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70466&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70466&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70466&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70466&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70466&r=mysqlcfg