import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-array / array_walk_recursive_object1.php
blob701542f8286558d2690e77b5d370e87e22766af0
1 <?php
2 /* Prototype : bool array_walk_recursive(array $input, string $funcname [, mixed $userdata])
3 * Description: Apply a user function to every member of an array
4 * Source code: ext/standard/array.c
5 */
7 /* Passing object in place of an 'input' argument to test object functionality
8 */
9 echo "*** Testing array_walk_recursive() : object functionality ***\n";
12 * Prototype : callback(mixed $value, mixed $key, int $addvalue
13 * Parameters : $value - values in given input array
14 * $key - keys in given input array
15 * $addvalue - value to be added
16 * Description : Function adds the addvalue to each element of an array
19 function callback($value, $key, $user_data)
21 var_dump($key);
22 var_dump($value);
23 var_dump($user_data);
24 echo "\n";
27 class MyClass
29 private $pri_value;
30 public $pub_value;
31 protected $pro_value;
32 public function __construct($setVal)
34 $this->pri_value = $setVal;
35 $this->pub_value = $setVal;
36 $this->pro_value = $setVal;
38 };
40 // object for 'input' argument
41 $input = new MyClass(10);
43 var_dump( array_walk_recursive($input, "callback", 1));
45 echo "Done"