Annotation of embedaddon/php/ext/standard/tests/array/array_reduce_variation2.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test array_reduce() function : variation - invalid parameters
3: --FILE--
4: <?php
5: /* Prototype : mixed array_reduce(array input, mixed callback [, int initial])
6: * Description: Iteratively reduce the array to a single value via the callback.
7: * Source code: ext/standard/array.c
8: * Alias to functions:
9: */
10:
11: echo "*** Testing array_reduce() : variation - invalid parameters ***\n";
12:
13:
14: $array = array(1);
15:
16: var_dump(array_reduce($array, "bogusbogus"));
17:
18: var_dump(array_reduce("bogusarray", "max"));
19:
20: var_dump(array_reduce(new stdClass(), "max"));
21:
22: ?>
23: ===DONE===
24: --EXPECTF--
25: *** Testing array_reduce() : variation - invalid parameters ***
26:
27: Warning: array_reduce() expects parameter 2 to be a valid callback, function 'bogusbogus' not found or invalid function name in %sarray_reduce_variation2.php on line %d
28: NULL
29:
30: Warning: array_reduce() expects parameter 1 to be array, string given in %sarray_reduce_variation2.php on line %d
31: NULL
32:
33: Warning: array_reduce() expects parameter 1 to be array, object given in %sarray_reduce_variation2.php on line %d
34: NULL
35: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>