Re: [PHP-DEV] [RFC] Readonly constructors

2025-05-22 Thread Rob Landers
On Thu, May 22, 2025, at 17:01, Mihail Liahimov wrote: > In PHP 8.1 the class read-on syntax was added, which allows you to create > classes that are completely closed to changes. In addition, it allows you to > write less boilerplate when declaring a property in the constructor. > > Before 8.1:

[PHP-DEV] [RFC] Readonly constructors

2025-05-22 Thread Mihail Liahimov
In PHP 8.1 the class read-on syntax was added, which allows you to create classes that are completely closed to changes. In addition, it allows you to write less boilerplate when declaring a property in the constructor. Before 8.1: class A { public function __construct( private readon