#34335 [Bgs]: nested array_walk calls fail
| From: | sniper@php.net | Date: | Thu, 01 Sep 2005 21:42:00 +0000 |
| Subject: | #34335 [Bgs]: nested array_walk calls fail | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-84330@lists.php.net to get a copy of this message | ||
ID: 34335
Updated by: sniper@php.net
Reported By: gubespam at _NOSPAM_gmail dot com
Status: Bogus
Bug Type: Arrays related
Operating System: Apache/Unix
PHP Version: 5.0.4
New Comment:
And with CVS I mean PHP 5.1-dev..
Previous Comments:
------------------------------------------------------------------------
[2005-09-01 23:41:26] sniper@php.net
It's fixed in CVS. Did you really expect that we get it fixed in your
installed 5.0.4 with some magic or what?
------------------------------------------------------------------------
[2005-09-01 19:56:53] gubespam at _NOSPAM_gmail dot com
Description:
------------
When making nested calls to array_walk, it does not behave as it
should. Supposedly this has been fixed, but it doesn't appear so.
Please refer to the now-closed bug report #33286. To see it working on
my server running 5.0.4, go to:
http://web.ics.purdue.edu/~varsity/array_walk.php
Reproduce code:
---------------
<?php
function test_subfunc(&$item1, $key, &$prefix)
{
echo " test_subfunc<br/>";
}
function test_func($item2, $key)
{
echo "test_func<br/>";
$arr = array(1, 2, 3, 4);
array_walk($arr, 'test_subfunc', 'extra_arg');
}
$x = array(5,6,7);
array_walk($x, 'test_func');
?>
Expected result:
----------------
test_func
test_subfunc
test_subfunc
test_subfunc
test_subfunc
test_func
test_subfunc
test_subfunc
test_subfunc
test_subfunc
test_func
test_subfunc
test_subfunc
test_subfunc
test_subfunc
Actual result:
--------------
test_func
test_subfunc
test_subfunc
test_subfunc
test_subfunc
Warning: Missing argument 3 for test_subfunc() in array_walk.php on
line 2
test_subfunc
Warning: Missing argument 3 for test_subfunc() in array_walk.php on
line 2
test_subfunc
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34335&edit=1