]> granicus.if.org Git - php/commitdiff
test case for array_sum
authorAndrey Hristov <andrey@php.net>
Thu, 18 Dec 2003 22:12:29 +0000 (22:12 +0000)
committerAndrey Hristov <andrey@php.net>
Thu, 18 Dec 2003 22:12:29 +0000 (22:12 +0000)
ext/standard/tests/array/array_sum.phpt [new file with mode: 0644]

diff --git a/ext/standard/tests/array/array_sum.phpt b/ext/standard/tests/array/array_sum.phpt
new file mode 100644 (file)
index 0000000..d44d605
--- /dev/null
@@ -0,0 +1,27 @@
+--TEST--
+Test array_sum()
+--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);
+?>
+--EXPECT--
+int(500500)
+int(500500)
+float(5000050000)
+float(5000050000)
\ No newline at end of file