]> granicus.if.org Git - php/commitdiff
add new tests (which produces segfault with 4.4 atm)
authorAntony Dovgal <tony2001@php.net>
Fri, 19 May 2006 11:17:53 +0000 (11:17 +0000)
committerAntony Dovgal <tony2001@php.net>
Fri, 19 May 2006 11:17:53 +0000 (11:17 +0000)
tests/lang/bug35239.phpt [new file with mode: 0755]

diff --git a/tests/lang/bug35239.phpt b/tests/lang/bug35239.phpt
new file mode 100755 (executable)
index 0000000..7fc7b7d
--- /dev/null
@@ -0,0 +1,41 @@
+--TEST--
+Bug #35239 (Objects can lose references)
+--FILE--
+<?php
+$a = new stdClass; 
+$a->x0 = new stdClass;
+$a->x0->y0 = 'a';
+$a->x0->y1 =& $a->x0;
+$a->x0->y2 =& $a->x0;
+$a->x0->y0 = 'b';
+var_dump($a);
+$a->x0->y1 = "ok\n";
+echo $a->x0;
+?>
+--EXPECT--
+object(stdClass)#1 (1) {
+  ["x0"]=>
+  &object(stdClass)#2 (3) {
+    ["y0"]=>
+    string(1) "b"
+    ["y1"]=>
+    &object(stdClass)#2 (3) {
+      ["y0"]=>
+      string(1) "b"
+      ["y1"]=>
+      *RECURSION*
+      ["y2"]=>
+      *RECURSION*
+    }
+    ["y2"]=>
+    &object(stdClass)#2 (3) {
+      ["y0"]=>
+      string(1) "b"
+      ["y1"]=>
+      *RECURSION*
+      ["y2"]=>
+      *RECURSION*
+    }
+  }
+}
+ok