1--TEST--
2Test array_sum() function : usage variations - array with duplicate values
3--FILE--
4<?php
5/*
6* Checking array_sum() with integer and float array containing duplicate values
7*/
8
9echo "*** Testing array_sum() : array with duplicate values ***\n";
10
11// integer array with duplicate values
12$int_input = array( 2, 5, 7, 5, 0, -4, 2, 100);
13echo "-- With integer array --\n";
14var_dump( array_sum($int_input) );
15
16// float array with duplicate values
17$float_input = array( 2.3, 1.9, -4.1, 0.5, 1.9, -4.1, 3.6, 0.5);
18echo "-- With float array --\n";
19var_dump( array_sum($float_input) );
20
21echo "Done"
22?>
23--EXPECT--
24*** Testing array_sum() : array with duplicate values ***
25-- With integer array --
26int(117)
27-- With float array --
28float(2.5)
29Done
30