#34335 [NEW]: nested array_walk calls fail
| From: | gubespam at _NOSPAM_gmail dot com | Date: | Thu, 01 Sep 2005 17:56:54 +0000 |
| Subject: | #34335 [NEW]: nested array_walk calls fail | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-84315@lists.php.net to get a copy of this message | ||
From: gubespam at _NOSPAM_gmail dot com
Operating system: Apache/Unix
PHP version: 5.0.4
PHP Bug Type: Arrays related
Bug description: nested array_walk calls fail
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 bug report at http://bugs.php.net/?id=34335&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34335&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34335&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34335&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34335&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34335&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34335&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34335&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34335&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34335&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34335&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=34335&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=34335&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34335&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34335&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34335&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34335&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34335&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34335&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34335&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34335&r=mysqlcfg