xref: /PHP-7.4/Zend/tests/bug66609.phpt (revision 6f4af2da)
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--
27Notice: Undefined property: Bar::$bar in %sbug66609.php on line %d
28okey
29