import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-array / array_sum_variation6.php
blob697bd6bbbeead1ea6d1486dd14f394cb1b695a8a
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 /*
8 * Testing array_sum() with associative array as 'input' argument
9 */
11 echo "*** Testing array_sum() : with associative array ***\n";
13 // array with numeric keys
14 $input = array(0 => 1, 1 => 10, 2 => 0, 3 => -2, 4 => 23.56);
15 echo "-- with numeric keys --\n";
16 var_dump( array_sum($input) );
18 // array with string keys
19 $input = array('a' => 20, "b" => 50, 'c' => 0, 'd' => -30, "e" => 100);
20 echo "-- with string keys --\n";
21 var_dump( array_sum($input) );
22 echo "Done"