xref: /PHP-8.2/Zend/tests/bug27268.phpt (revision 902d6439)
1--TEST--
2Bug #27268 (Bad references accentuated by clone)
3--FILE--
4<?php
5#[AllowDynamicProperties]
6class A
7{
8    public function &getA()
9    {
10        return $this->a;
11    }
12}
13
14$A = new A;
15$A->a = array(1);
16$x = $A->getA();
17$clone = clone $A;
18$clone->a = array();
19print_r($A);
20?>
21--EXPECT--
22A Object
23(
24    [a] => Array
25        (
26            [0] => 1
27        )
28
29)
30