1--TEST--
2Test array_walk_recursive() function : usage variations - 'input' argument containing reference variables
3--FILE--
4<?php
5/*
6 * Testing array_walk_recursive() with an array having reference variables
7*/
8
9echo "*** Testing array_walk_recursive() : array with references ***\n";
10
11$value1 = 10;
12$value2 = -20;
13$value3 = &$value1;
14$value4 = 50;
15
16// 'input' array containing references to above variables
17$input = array(&$value1, array(&$value2, -35), array(&$value3, 0), array(&$value4));
18
19function callback($value, $key)
20{
21   // dump the arguments to check that they are passed
22   // with proper type
23   var_dump($key);  // key
24   var_dump($value); // value
25   echo "\n"; // new line to separate the output between each element
26}
27
28var_dump( array_walk_recursive($input, "callback"));
29
30echo "Done"
31?>
32--EXPECT--
33*** Testing array_walk_recursive() : array with references ***
34int(0)
35int(10)
36
37int(0)
38int(-20)
39
40int(1)
41int(-35)
42
43int(0)
44int(10)
45
46int(1)
47int(0)
48
49int(0)
50int(50)
51
52bool(true)
53Done
54