1--TEST--
2Test array_sum() function : usage variations - array with different integer value
3--FILE--
4<?php
5/*
6* Testing array_sum() with different types of integer arrays containing data of following type:
7*  integer, octal, hexadecimal, maximum and minimum integer values & mixed of all integers
8*/
9
10echo "*** Testing array_sum() : different integer array ***\n";
11
12// Int array
13$int_values = array(3, 2, 100, 150, 25, 350, 0, -3, -1200);
14echo "-- Sum of Integer array --\n";
15var_dump( array_sum($int_values) );
16
17// Octal array
18$octal_values = array(056, 023, 00, 015, -045, 01, -07);
19echo "-- Sum of Octal array --\n";
20var_dump( array_sum($octal_values) );
21
22// Hexadecimal array
23$hex_values = array(0xAE, 0x2B, 0X10, -0xCF, 0X12, -0XF2);
24echo "-- Sum of Hex array --\n";
25var_dump( array_sum($hex_values) );
26
27// Mixed values int, octal & hex
28$mixed_int_value = array(2, 5, -1, 054, 0X3E, 0, -014, -0x2A);
29echo "-- Sum of mixed integer values --\n";
30var_dump( array_sum($mixed_int_value) );
31
32echo "Done"
33?>
34--EXPECT--
35*** Testing array_sum() : different integer array ***
36-- Sum of Integer array --
37int(-573)
38-- Sum of Octal array --
39int(35)
40-- Sum of Hex array --
41int(-198)
42-- Sum of mixed integer values --
43int(58)
44Done
45