Bug #65639 [NEW]: in_array unexpected result
| From: | sv3tli0 at bgspot dot eu | Date: | Mon, 09 Sep 2013 07:35:53 +0000 |
| Subject: | Bug #65639 [NEW]: in_array unexpected result | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-181479@lists.php.net to get a copy of this message | ||
From: sv3tli0 at bgspot dot eu
Operating system: Ubuntu 13.04
PHP version: 5.4.19
Package: Arrays related
Bug Type: Bug
Bug description:in_array unexpected result
Description:
------------
Wrong result if you are checking array for existing integer 0, when array
has
none integer values..
Test script:
---------------
$array = array(1,2,3);
var_dump(in_array(0, $array));
$array = array(1,2,'some string not INT');
var_dump(in_array(0, $array));
Expected result:
----------------
boolean false
boolean false
Actual result:
--------------
boolean false
boolean true
--
Edit bug report at https://bugs.php.net/bug.php?id=65639&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=65639&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=65639&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=65639&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=65639&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=65639&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=65639&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=65639&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=65639&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=65639&r=support
Expected behavior: https://bugs.php.net/fix.php?id=65639&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=65639&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=65639&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=65639&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65639&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=65639&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=65639&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=65639&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65639&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=65639&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=65639&r=mysqlcfg