#32484 [NEW]: in_array() doesn't return with an undefined array
| From: | edwin at mavetju dot org | Date: | Tue, 29 Mar 2005 12:50:22 +0000 |
| Subject: | #32484 [NEW]: in_array() doesn't return with an undefined array | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-75977@lists.php.net to get a copy of this message | ||
From: edwin at mavetju dot org
Operating system: FreeBSD 5.2.1
PHP version: 4.3.10
PHP Bug Type: Arrays related
Bug description: in_array() doesn't return with an undefined array
Description:
------------
I know this is wrong programming style, but in_array() hangs on this
FreeBSD 5.2.1 box with PHP 4.3.10 when the haystack is an undefined
array.
It has the expected behaviour on FreeBSD 4.x and FreeBSD 5.3, it's just
showing up in 5.2.1.
This is an FYI bug report, it might be that you have had similar reports
but never been able to put your fingers on the place where it hurted.
Reproduce code:
---------------
$a=array("foo");
if (!@in_array("bar",$a["foo"])) {
echo "Not there\n";
}
Expected result:
----------------
"Not there"
Actual result:
--------------
The interpreter hangs in the in_array() function.
--
Edit bug report at http://bugs.php.net/?id=32484&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32484&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32484&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32484&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32484&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32484&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32484&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32484&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32484&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32484&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32484&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=32484&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=32484&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32484&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32484&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32484&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32484&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32484&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32484&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32484&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32484&r=mysqlcfg