xref: /PHP-8.4/Zend/tests/bug52879.phpt (revision 7aacc705)
1--TEST--
2Bug #52879 (Objects unreferenced in __get, __set, __isset or __unset can be freed too early)
3--FILE--
4<?php
5class MyClass {
6    public $myRef;
7    public function __set($property,$value) {
8        $this->myRef = $value;
9    }
10}
11$myGlobal=new MyClass();
12$myGlobal->myRef=&$myGlobal;
13$myGlobal->myNonExistentProperty="ok\n";
14echo $myGlobal;
15?>
16--EXPECT--
17ok
18