]> granicus.if.org Git - php/commitdiff
Test for bug #27268. It is fixed in HEAD but not in PHP_5_0.
authorDmitry Stogov <dmitry@php.net>
Thu, 23 Jun 2005 08:24:42 +0000 (08:24 +0000)
committerDmitry Stogov <dmitry@php.net>
Thu, 23 Jun 2005 08:24:42 +0000 (08:24 +0000)
Zend/tests/bug27268.phpt [new file with mode: 0755]

diff --git a/Zend/tests/bug27268.phpt b/Zend/tests/bug27268.phpt
new file mode 100755 (executable)
index 0000000..a86e8d0
--- /dev/null
@@ -0,0 +1,28 @@
+--TEST--
+Bug #27268 (Bad references accentuated by clone)
+--FILE--
+<?php
+class A
+{
+    public function &getA()
+    {
+        return $this->a;
+    }
+}
+
+$A = new A;
+$A->a = array(1);
+$x = $A->getA();
+$clone = clone $A;
+$clone->a = array();
+print_r($A);
+?>
+--EXPECT--
+A Object
+(
+    [a] => Array
+        (
+            [0] => 1
+        )
+
+)