Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / php / ext / standard / tests / array / array_walk_objects.phpt
blob506d1cafcfa71fc1d5c4c97402b7398a15ba3561
1 --TEST--
2 array_walk() and objects
3 --FILE--
4 <?php
6 function walk($key, $value) { 
7         var_dump($value, $key); 
10 class test {
11         private $var_pri = "test_private";
12         protected $var_pro = "test_protected";
13         public $var_pub = "test_public";
16 $stdclass = new stdclass;
17 $stdclass->foo = "foo";
18 $stdclass->bar = "bar";
19 array_walk($stdclass, "walk");
21 $t = new test;
22 array_walk($t, "walk");
24 $var = array();
25 array_walk($var, "walk");
26 $var = "";
27 array_walk($var, "walk");
29 echo "Done\n";
31 --EXPECTF--     
32 %unicode|string%(3) "foo"
33 %unicode|string%(3) "foo"
34 %unicode|string%(3) "bar"
35 %unicode|string%(3) "bar"
36 %unicode|string%(13) "%r\0%rtest%r\0%rvar_pri"
37 %unicode|string%(12) "test_private"
38 %unicode|string%(10) "%r\0%r*%r\0%rvar_pro"
39 %unicode|string%(14) "test_protected"
40 %unicode|string%(7) "var_pub"
41 %unicode|string%(11) "test_public"
43 Warning: array_walk() expects parameter 1 to be array, %unicode_string_optional% given in %s on line %d
44 Done