PHP :: Bug #29954 :: array_reduce crashes
| Bug #29954 | array_reduce crashes | ||||
|---|---|---|---|---|---|
| Submitted: | 2004-09-02 16:24 UTC | Modified: | 2004-11-28 18:06 UTC | ||
| From: | tomas_matousek at hotmail dot com | Assigned: | |||
| Status: | Closed | Package: | Reproducible crash | ||
| PHP Version: | 5.0.1 | OS: | WinXP | ||
| Private report: | No | CVE-ID: | None | ||
[2004-09-02 16:24 UTC] tomas_matousek at hotmail dot com
Description:
------------
array_reduce function crashes PHP in the following case
Reproduce code:
---------------
function &t(&$a, &$b)
{
static $o = 1;
$a[$b] = $o;
$b = $o;
$o++;
return $a;
}
$array0 = array("a", "b", "c", "d", "e");
$array1 = array();
print_r(array_reduce($array0,"t",$array1));
print_r($array0);
print_r($array1);
Expected result:
----------------
Array
(
[a] => 1
[b] => 2
[c] => 3
[d] => 4
[e] => 5
)
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 5
)
Array
(
[a] => 1
[b] => 2
[c] => 3
[d] => 4
[e] => 5
)
Actual result:
--------------
crash
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2004-09-02 16:56 UTC] tomas_matousek at hotmail dot com
[2004-11-28 18:06 UTC] tony2001@php.net