]> granicus.if.org Git - php/commitdiff
This commit was manufactured by cvs2svn to create branch 'PHP_4_3'.
authorSVN Migration <svn@php.net>
Sun, 11 May 2003 06:33:36 +0000 (06:33 +0000)
committerSVN Migration <svn@php.net>
Sun, 11 May 2003 06:33:36 +0000 (06:33 +0000)
ext/standard/tests/array/bug22463.phpt [new file with mode: 0644]
ext/standard/tests/array/bug23581.phpt [new file with mode: 0644]

diff --git a/ext/standard/tests/array/bug22463.phpt b/ext/standard/tests/array/bug22463.phpt
new file mode 100644 (file)
index 0000000..dcede51
--- /dev/null
@@ -0,0 +1,29 @@
+--TEST--
+Bug #22463 (array_reduce() segfaults)
+--FILE--
+<?php
+
+function a($ary) {
+       return (is_array($ary) ? array_reduce($ary, 'cb', 0) : 1);
+}
+
+function cb($v, $elem) {
+       return $v + a($elem); 
+}
+
+$ary = array(
+       array(
+               array(
+                       array(
+                               array(
+                                       array(0, 1, 2, 3, 4)
+                               )
+                       )
+               )
+       )
+);
+
+var_dump(a($ary));
+?>
+--EXPECT--
+int(5)
diff --git a/ext/standard/tests/array/bug23581.phpt b/ext/standard/tests/array/bug23581.phpt
new file mode 100644 (file)
index 0000000..06e1e38
--- /dev/null
@@ -0,0 +1,44 @@
+--TEST--
+Bug #23581 (array_map(NULL, array, array, ...) yields an undefined result)
+--FILE--
+<?php
+var_dump(
+  array_map(
+    NULL,
+    array(1,2,3),
+    array(4,5,6),
+    array(7,8,9)
+  )
+);
+?>
+--EXPECT--
+array(3) {
+  [0]=>
+  array(3) {
+    [0]=>
+    int(1)
+    [1]=>
+    int(4)
+    [2]=>
+    int(7)
+  }
+  [1]=>
+  array(3) {
+    [0]=>
+    int(2)
+    [1]=>
+    int(5)
+    [2]=>
+    int(8)
+  }
+  [2]=>
+  array(3) {
+    [0]=>
+    int(3)
+    [1]=>
+    int(6)
+    [2]=>
+    int(9)
+  }
+}
+