1--TEST--
2Test array_sum() function : usage variations - array with reference variables as elements
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
10/*
11* Testing array_sum() with 'input' having reference variables as elements
12*/
13
14echo "*** Testing array_sum() : array with elements as reference ***\n";
15
16$value1 = -5;
17$value2 = 100;
18$value3 = 0;
19$value4 = &$value1;
20
21// input array containing elements as reference variables
22$input = array(
23  0 => 10,
24  1 => &$value4,
25  2 => &$value2,
26  3 => 200,
27  4 => &$value3,
28);
29
30var_dump( array_sum($input) );
31
32echo "Done"
33?>
34--EXPECTF--
35*** Testing array_sum() : array with elements as reference ***
36int(305)
37Done
38