File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / array / array_sum.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:03 2012 UTC (12 years, 4 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--TEST--
Test array_sum()
--INI--
precision=14
memory_limit=128M
--FILE--
<?php
$i = 0;
while ($i++ < 1000) {
	$a[] = $i;
	$b[] = (string)$i;
}
$s1 = array_sum($a);
$s2 = array_sum($b);
var_dump($s1, $s2);

$j = 0;
while ($j++ < 100000) {
	$c[] = $j;
	$d[] = (string) $j;
}
$s3 = array_sum($c);
$s4 = array_sum($d);
var_dump($s3, $s4);
?>
--EXPECTF--
int(500500)
int(500500)
%st(5000050000)
%st(5000050000)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>