xref: /PHP-8.4/ext/opcache/tests/jit/inc_obj_006.phpt (revision c16ad918)
1--TEST--
2PRE_INC_OBJ: 006
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.file_update_protection=0
7opcache.protect_memory=1
8--FILE--
9<?php
10$a = new class {
11    public int $foo = 0;
12
13    function &__get($x) {
14        return $this->foo;
15    }
16
17    function __set($x, $y) {
18        echo "set($y)\n";
19    }
20};
21
22--$a->x->y;
23?>
24DONE
25--EXPECTF--
26Fatal error: Uncaught Error: Attempt to increment/decrement property "y" on int in %sinc_obj_006.php:14
27Stack trace:
28#0 {main}
29  thrown in %sinc_obj_006.php on line 14
30
31