1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/Zend/tests/magic_methods/bug66609.phpt
DanielEScherzer d22abca488 Zend/tests: organize some tests with sub directories (5) (#17800)
Second pass through `Zend/tests/bug*` to organize the tests.

Move tests to existing sub directories, and create some new sub directories:
* `ArrayAccess`
* `autoload`
* `clone`
* `serialize` (also covers `unserialize()`)
* `switch`

Work towards GH-15631
2025-02-14 11:49:14 +00:00

30 lines
562 B
PHP

--TEST--
Bug #66609 (php crashes with __get() and ++ operator in some cases)
--FILE--
<?php
$bar = new Bar;
$foo = new Foo;
class Bar {
public function __get($x) {
global $foo;
return $foo->foo;
}
}
#[AllowDynamicProperties]
class Foo {
public function __get($x) {
global $bar;
return $bar->bar;
}
}
$foo->blah += 1; //crash
++$foo->blah; //crash
$foo->blah++; //crash
$foo->blah--; //crash
--$foo->blah; //crash
echo "okey";
?>
--EXPECTF--
Warning: Undefined property: Bar::$bar in %s on line %d
okey