1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 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 ) )