1--TEST--
2array_walk() tests
3--FILE--
4<?php
5
6function foo($v1, $v2, $v3) {
7    var_dump($v1);
8    var_dump($v2);
9    var_dump($v3);
10}
11
12$var = array(1,2);
13var_dump(array_walk($var, "foo", "data"));
14
15function foo2($v1, $v2, $v3) {
16    throw new Exception($v3);
17}
18
19try {
20    var_dump(array_walk($var,"foo2", "data"));
21} catch (Exception $e) {
22    var_dump($e->getMessage());
23}
24
25echo "Done\n";
26?>
27--EXPECT--
28int(1)
29int(0)
30string(4) "data"
31int(2)
32int(1)
33string(4) "data"
34bool(true)
35string(4) "data"
36Done
37