Re: [PHP-DEV] Default value for readonly properties

2024-06-07 Thread Larry Garfield
On Fri, Jun 7, 2024, at 9:07 AM, Claude Pache wrote: > Hi, > > As of today, readonly properties cannot have a default value: > > ```php > class UltimateQuestion { > readonly int $answer = 42; // Fatal error: Readonly property > Question::$answer cannot have default value > } > ``` > > The rati

Re: [PHP-DEV] Default value for readonly properties

2024-06-07 Thread Valentin Udaltsov
On Friday, 7 June 2024 at 12:11, Claude Pache wrote: > Hi, > > As of today, readonly properties cannot have a default value: > > ```php > class UltimateQuestion { > readonly int $answer = 42; // Fatal error: Readonly property > Question::$answer cannot have default value > } > ``` > > The rat