Initialize Readonly On Child

no-email (Damien Seguy), Damien Seguy
Wed, 16 Oct 2024 00:00:00 +0000

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.