mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
6780aaa532
Add support for readonly properties, for which only a single initializing assignment from the declaring scope is allowed. RFC: https://wiki.php.net/rfc/readonly_properties_v2 Closes GH-7089.
13 lines
196 B
PHP
13 lines
196 B
PHP
--TEST--
|
|
Readonly static property
|
|
--FILE--
|
|
<?php
|
|
|
|
class Test {
|
|
public static readonly int $prop;
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Static property Test::$prop cannot be readonly in %s on line %d
|