Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
--TEST--
2
Function -- array_walk_recursive
3
--SKIPIF--
4
<?php if (function_exists('array_walk_recursive')) { echo 'skip'; } ?>
5
--FILE--
6
<?php
7
require_once 'PHP/Compat.php';
8
PHP_Compat::loadFunction('array_walk_recursive');
9
 
10
$sweet = array('a' => 'apple', 'b' => 'banana');
11
$fruits = array('sweet' => $sweet, 'sour' => 'lemon');
12
 
13
function test_print($item, $key)
14
{
15
   echo "$key holds $item\n";
16
}
17
 
18
array_walk_recursive($fruits, 'test_print');
19
?>
20
--EXPECT--
21
a holds apple
22
b holds banana
23
sour holds lemon