2
Test array_product() function : error conditions
5
/* Prototype : mixed array_product(array input)
6
* Description: Returns the product of the array entries
7
* Source code: ext/standard/array.c
11
echo "*** Testing array_product() : error conditions ***\n";
14
echo "\n-- Testing array_product() function with Zero arguments --\n";
15
var_dump( array_product() );
17
//Test array_product with one more than the expected number of arguments
18
echo "\n-- Testing array_product() function with more than expected no. of arguments --\n";
21
var_dump( array_product($input, $extra_arg) );
23
echo "\n-- Testing array_product() function incorrect argument type --\n";
24
var_dump( array_product("bob") );
29
*** Testing array_product() : error conditions ***
31
-- Testing array_product() function with Zero arguments --
33
Warning: array_product() expects exactly 1 parameter, 0 given in %sarray_product_error.php on line %d
36
-- Testing array_product() function with more than expected no. of arguments --
38
Warning: array_product() expects exactly 1 parameter, 2 given in %sarray_product_error.php on line %d
41
-- Testing array_product() function incorrect argument type --
43
Warning: array_product() expects parameter 1 to be array, string given in %sarray_product_error.php on line %d