1--TEST--
2Test array_walk() function : usage variations - buit-in function as callback
3--FILE--
4<?php
5/*
6 * Passing different buit-in functionns as callback function
7 *    pow function
8 *    min function
9 *    echo language construct
10*/
11
12echo "*** Testing array_walk() : built-in function as callback ***\n";
13
14$input = array(2 => 1, 65, 98, 100, 6 => -4);
15
16echo "-- With 'pow' built-in function --\n";
17var_dump( array_walk($input, 'pow'));
18
19echo "-- With 'min' built-in function --\n";
20var_dump( array_walk($input, "min"));
21
22echo "-- With 'echo' language construct --\n";
23try {
24    var_dump( array_walk($input, "echo"));
25} catch (TypeError $e) {
26    echo $e->getMessage(), "\n";
27}
28
29echo "Done"
30?>
31--EXPECT--
32*** Testing array_walk() : built-in function as callback ***
33-- With 'pow' built-in function --
34bool(true)
35-- With 'min' built-in function --
36bool(true)
37-- With 'echo' language construct --
38array_walk(): Argument #2 ($callback) must be a valid callback, function "echo" not found or invalid function name
39Done
40