]> granicus.if.org Git - php/commitdiff
This commit was manufactured by cvs2svn to create branch 'PHP_4_3'.
authorSVN Migration <svn@php.net>
Mon, 26 May 2003 03:55:09 +0000 (03:55 +0000)
committerSVN Migration <svn@php.net>
Mon, 26 May 2003 03:55:09 +0000 (03:55 +0000)
ext/standard/tests/array/bug23788.phpt [new file with mode: 0644]
tests/lang/bug17115.phpt [new file with mode: 0644]

diff --git a/ext/standard/tests/array/bug23788.phpt b/ext/standard/tests/array/bug23788.phpt
new file mode 100644 (file)
index 0000000..022b3ce
--- /dev/null
@@ -0,0 +1,24 @@
+--TEST--
+Bug #23788 (*_replace() clobbers referenced array elements)
+--FILE--
+<?php
+$numeric = 123;
+$bool = true;
+$foo = array(&$numeric, &$bool);
+var_dump($foo);
+str_replace("abc", "def", $foo);
+var_dump($foo);
+?>
+--EXPECT--
+array(2) {
+  [0]=>
+  &int(123)
+  [1]=>
+  &bool(true)
+}
+array(2) {
+  [0]=>
+  &int(123)
+  [1]=>
+  &bool(true)
+}
diff --git a/tests/lang/bug17115.phpt b/tests/lang/bug17115.phpt
new file mode 100644 (file)
index 0000000..0cb3bf4
--- /dev/null
@@ -0,0 +1,16 @@
+--TEST--
+Bug #17115 (lambda functions produce segfault with static vars)
+--FILE--
+<?php
+$func = create_function('','
+       static $foo = 0;
+       return $foo++;
+');
+var_dump($func());
+var_dump($func());
+var_dump($func());
+?>
+--EXPECT--
+int(0)
+int(1)
+int(2)