1--TEST-- 2Test array_sum() function : basic functionality 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() : basic functionality ***\n"; 11 12// array with integer values 13$input = array(1, 2, 3, 4, 5); 14echo "-- array_sum() with integer array entries --\n"; 15var_dump( array_sum($input) ); 16 17// array with float values 18$input = array(1.0, 2.2, 3.4, 4.6); 19echo "-- array_sum() with float array entries --\n"; 20var_dump( array_sum($input) ); 21 22// array with integer and float values 23$input = array(1, 2.3, 4, 0.6, 10); 24echo "-- array_sum() with integer/float array entries --\n"; 25var_dump( array_sum($input) ); 26 27echo "Done" 28?> 29--EXPECT-- 30*** Testing array_sum() : basic functionality *** 31-- array_sum() with integer array entries -- 32int(15) 33-- array_sum() with float array entries -- 34float(11.2) 35-- array_sum() with integer/float array entries -- 36float(17.9) 37Done 38