1--TEST--
2Test array_walk_recursive() 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_recursive() : built-in function as callback ***\n";
13
14$input = array(array(2 => 1, 65), array(98, 100), array(6 => -4));
15
16echo "-- With 'pow' built-in function --\n";
17var_dump( array_walk_recursive($input, 'pow'));
18
19echo "-- With 'min' built-in function --\n";
20var_dump( array_walk_recursive($input, "min"));
21
22echo "-- With 'echo' language construct --\n";
23try {
24    var_dump( array_walk_recursive($input, "echo"));
25} catch (TypeError $e) {
26    echo $e->getMessage(), "\n";
27}
28
29echo "Done"
30?>
31--EXPECT--
32*** Testing array_walk_recursive() : 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_recursive(): Argument #2 ($callback) must be a valid callback, function "echo" not found or invalid function name
39Done
40