php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32484 in_array() doesn't return with an undefined array
Submitted: 2005-03-29 14:50 UTC Modified: 2005-03-29 14:54 UTC
From: edwin at mavetju dot org Assigned:
Status: Closed Package: Arrays related
PHP Version: 4.3.10 OS: FreeBSD 5.2.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: edwin at mavetju dot org
New email:
PHP Version: OS:

 

 [2005-03-29 14:50 UTC] edwin at mavetju dot org
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-29 14:54 UTC] sniper@php.net
Works fine with latest CVS / PHP 4.3.11RC2 / PHP 5.0.4RC2

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 01 11:01:32 2024 UTC