1--TEST--
2Test array_sum() function : error conditions
3--FILE--
4<?php
5/* Prototype  : mixed array_sum(array &input)
6 * Description: Returns the sum of the array entries
7 * Source code: ext/standard/array.c
8*/
9
10echo "*** Testing array_sum() : error conditions ***\n";
11
12// Zero arguments
13echo "-- Testing array_sum() function with zero arguments --\n";
14var_dump( array_sum() );
15
16// One more than the expected number of arguments
17echo "-- Testing array_sum() function with more than expected no. of arguments --\n";
18$input = array(1, 2, 3, 4);
19$extra_arg = 10;
20var_dump( array_sum($input, $extra_arg) );
21
22echo "Done"
23?>
24--EXPECTF--
25*** Testing array_sum() : error conditions ***
26-- Testing array_sum() function with zero arguments --
27
28Warning: array_sum() expects exactly 1 parameter, 0 given in %s on line %d
29NULL
30-- Testing array_sum() function with more than expected no. of arguments --
31
32Warning: array_sum() expects exactly 1 parameter, 2 given in %s on line %d
33NULL
34Done
35