|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-09-02 16:56 UTC] tomas_matousek at hotmail dot com
[2004-11-28 18:06 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 01:00:01 2025 UTC |
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