Initialize Readonly On Child¶
Readonly properties could only be initialized in the same class as their definition. That holds true, whatever the visibility of the property: private, protected, private.
In PHP 8.4, it is now possible to initialize the readonly properties from a child class, if the visibility allows. And the property is assigned only once.
See Also¶
Initialize Readonly On Child [Try me]