1--TEST--
2Test array_product() function : error conditions
3--FILE--
4<?php
5/* Prototype  : mixed array_product(array input)
6 * Description: Returns the product of the array entries
7 * Source code: ext/standard/array.c
8 * Alias to functions:
9 */
10
11echo "*** Testing array_product() : error conditions ***\n";
12
13// Zero arguments
14echo "\n-- Testing array_product() function with Zero arguments --\n";
15var_dump( array_product() );
16
17//Test array_product with one more than the expected number of arguments
18echo "\n-- Testing array_product() function with more than expected no. of arguments --\n";
19$input = array(1, 2);
20$extra_arg = 10;
21var_dump( array_product($input, $extra_arg) );
22
23echo "\n-- Testing array_product() function incorrect argument type --\n";
24var_dump( array_product("bob") );
25
26?>
27===DONE===
28--EXPECTF--
29*** Testing array_product() : error conditions ***
30
31-- Testing array_product() function with Zero arguments --
32
33Warning: array_product() expects exactly 1 parameter, 0 given in %sarray_product_error.php on line %d
34NULL
35
36-- Testing array_product() function with more than expected no. of arguments --
37
38Warning: array_product() expects exactly 1 parameter, 2 given in %sarray_product_error.php on line %d
39NULL
40
41-- Testing array_product() function incorrect argument type --
42
43Warning: array_product() expects parameter 1 to be array, string given in %sarray_product_error.php on line %d
44NULL
45===DONE===
46