1--TEST-- 2array_walk() tests 3--FILE-- 4<?php 5 6var_dump(array_walk()); 7$var = 1; 8var_dump(array_walk($var,1)); 9$var = array(); 10var_dump(array_walk($var,"")); 11 12function foo($v1, $v2, $v3) { 13 var_dump($v1); 14 var_dump($v2); 15 var_dump($v3); 16} 17 18$var = array(1,2); 19var_dump(array_walk($var, "foo", "data")); 20 21function foo2($v1, $v2, $v3) { 22 throw new Exception($v3); 23} 24 25try { 26 var_dump(array_walk($var,"foo2", "data")); 27} catch (Exception $e) { 28 var_dump($e->getMessage()); 29} 30 31echo "Done\n"; 32?> 33--EXPECTF-- 34Warning: array_walk() expects at least 2 parameters, 0 given in %s on line %d 35NULL 36 37Warning: array_walk() expects parameter 1 to be array, int given in %s on line %d 38NULL 39 40Warning: array_walk() expects parameter 2 to be a valid callback, function '' not found or invalid function name in %s on line %d 41NULL 42int(1) 43int(0) 44string(4) "data" 45int(2) 46int(1) 47string(4) "data" 48bool(true) 49string(4) "data" 50Done 51