1--TEST-- 2Test array_sum() function : usage variations - associative array 3--FILE-- 4<?php 5/* 6* Testing array_sum() with associative array as 'input' argument 7*/ 8 9echo "*** Testing array_sum() : with associative array ***\n"; 10 11// array with numeric keys 12$input = array(0 => 1, 1 => 10, 2 => 0, 3 => -2, 4 => 23.56); 13echo "-- with numeric keys --\n"; 14var_dump( array_sum($input) ); 15 16// array with string keys 17$input = array('a' => 20, "b" => 50, 'c' => 0, 'd' => -30, "e" => 100); 18echo "-- with string keys --\n"; 19var_dump( array_sum($input) ); 20echo "Done" 21?> 22--EXPECT-- 23*** Testing array_sum() : with associative array *** 24-- with numeric keys -- 25float(32.56) 26-- with string keys -- 27int(140) 28Done 29