2003-12-18 22:12:29 +00:00
|
|
|
--TEST--
|
|
|
|
Test array_sum()
|
2003-12-19 15:09:40 +00:00
|
|
|
--INI--
|
2007-04-26 23:30:00 +00:00
|
|
|
precision=14
|
2006-12-25 21:07:53 +00:00
|
|
|
memory_limit=128M
|
2003-12-18 22:12:29 +00:00
|
|
|
--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);
|
|
|
|
?>
|
2004-02-23 02:09:48 +00:00
|
|
|
--EXPECTF--
|
2003-12-18 22:12:29 +00:00
|
|
|
int(500500)
|
|
|
|
int(500500)
|
2004-02-23 02:09:48 +00:00
|
|
|
%st(5000050000)
|
|
|
|
%st(5000050000)
|