import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-array / array_sum_basic.php
blobd150b088e6162f8e3f9c2384da506ef669163d0b
1 <?php
2 /* Prototype : mixed array_sum(array &input)
3 * Description: Returns the sum of the array entries
4 * Source code: ext/standard/array.c
5 */
7 echo "*** Testing array_sum() : basic functionality ***\n";
9 // array with integer values
10 $input = array(1, 2, 3, 4, 5);
11 echo "-- array_sum() with integer array entries --\n";
12 var_dump( array_sum($input) );
14 // array with float values
15 $input = array(1.0, 2.2, 3.4, 4.6);
16 echo "-- array_sum() with float array entries --\n";
17 var_dump( array_sum($input) );
19 // array with integer and float values
20 $input = array(1, 2.3, 4, 0.6, 10);
21 echo "-- array_sum() with integer/float array entries --\n";
22 var_dump( array_sum($input) );
24 echo "Done"