xref: /PHP-8.2/Zend/tests/bug66609.phpt (revision 902d6439)
1--TEST--
2Bug #66609 (php crashes with __get() and ++ operator in some cases)
3--FILE--
4<?php
5$bar = new Bar;
6$foo = new Foo;
7class Bar {
8    public function __get($x) {
9        global $foo;
10        return $foo->foo;
11    }
12}
13#[AllowDynamicProperties]
14class Foo {
15    public function __get($x) {
16        global $bar;
17        return $bar->bar;
18    }
19}
20$foo->blah += 1; //crash
21++$foo->blah;    //crash
22$foo->blah++;    //crash
23$foo->blah--;    //crash
24--$foo->blah;    //crash
25echo "okey";
26?>
27--EXPECTF--
28Warning: Undefined property: Bar::$bar in %s on line %d
29okey
30