php-src/ext/standard/tests/array/array_sum_variation5.phpt
Steph Fox 833f4150a1 - killed off UEXPECT
- could someone please fix var_export2.phpt? NUL is corrupted, can't fix here
2008-05-26 23:36:10 +00:00

39 lines
821 B
PHP

--TEST--
Test array_sum() function : usage variations - array with reference variables
--FILE--
<?php
/* Prototype : mixed array_sum(array $input)
* Description: Returns the sum of the array entries
* Source code: ext/standard/array.c
*/
/*
* Testing array_sum() with 'input' containing different reference variables
*/
echo "*** Testing array_sum() : array with elements as reference ***\n";
// different variables which are used as elements of 'array_arg'
$value1 = -5;
$value2 = 100;
$value3 = 0;
$value4 = &$value1;
// input an array containing elements with reference variables
$input = array(
0 => 10,
1 => &$value4,
2 => &$value2,
3 => 200,
4 => &$value3,
);
var_dump( array_sum($input) );
echo "Done"
?>
--EXPECT--
*** Testing array_sum() : array with elements as reference ***
int(305)
Done