1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 10:43:30 +02:00
Files
2024-01-15 09:39:13 +01:00

25 lines
424 B
PHP

--TEST--
JIT readonly modification post-dec
--INI--
opcache.enable=1
opcache.enable_cli=1
--FILE--
<?php
class Foo {
public readonly int $bar;
public function __construct() {
$this->bar = 1;
$this->bar--;
}
}
new Foo();
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot modify readonly property Foo::$bar in %s:%d
Stack trace:
#0 %s(%d): Foo->__construct()
#1 {main}
thrown in %s on line %d