1--TEST--
2Readonly property with default value
3--FILE--
4<?php
5
6class Test {
7    public readonly int $prop = 1;
8}
9
10$test = new Test;
11try {
12    $test->prop = 2;
13} catch (Error $e) {
14    echo $e->getMessage(), "\n";
15}
16
17?>
18--EXPECTF--
19Fatal error: Readonly property Test::$prop cannot have default value in %s on line %d
20