php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31599 array_walk_recursive simply does nothing
Submitted: 2005-01-18 16:52 UTC Modified: 2005-01-19 08:00 UTC
From: vortexx at freemail dot hu Assigned:
Status: Closed Package: Arrays related
PHP Version: 5.0.2 OS: Windows 2000 SP4
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: vortexx at freemail dot hu
New email:
PHP Version: OS:

 

 [2005-01-18 16:52 UTC] vortexx at freemail dot hu
Description:
------------
array_walk_recursive simply refuses to do anything whatsoever (even with the example code in the PHP docs!), while array_walk works fine.

Please note:
I am using PHP 5.0.2 and not PHP5.0.3 because I am unable to us ethe latter due to another bug I reported, still open here: http://bugs.php.net/bug.php?id=31175

Reproduce code:
---------------
(taken from http://www.php.net/manual/en/function.array-walk-recursive.php)

$sweet = array('a' => 'apple', 'b' => 'banana');
$fruits = array('sweet' => $sweet, 'sour' => 'lemon');

function test_print($item, $key) 
{
   echo "$key holds $item\n";
}

array_walk_recursive($fruits, 'test_print');

Expected result:
----------------
a holds apple
b holds banana
sour holds lemon 

Actual result:
--------------
[nothing, just blank!]

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-19 08:00 UTC] vortexx at freemail dot hu
In the latest snapshot array_walk_recursive (and the sample code I provided here) works fine, so it seems the problem only existed in PHP 5.0.2 (perhaps in the win version only?) Thanks!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 28 23:01:27 2024 UTC