mirror of
https://github.com/php/php-src.git
synced 2026-04-28 10:43:30 +02:00
c16ad918ba
https://wiki.php.net/rfc/jit_config_defaults Closes GH-12678
25 lines
424 B
PHP
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
|