xref: /PHP-8.1/Zend/tests/bug66609.phpt (revision f8d79582)
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}
13class Foo {
14    public function __get($x) {
15        global $bar;
16        return $bar->bar;
17    }
18}
19$foo->blah += 1; //crash
20++$foo->blah;    //crash
21$foo->blah++;    //crash
22$foo->blah--;    //crash
23--$foo->blah;    //crash
24echo "okey";
25?>
26--EXPECTF--
27Warning: Undefined property: Bar::$bar in %s on line %d
28okey
29