Set readonly Properties Outside The Class

no-email (Damien Seguy), Damien Seguy
Mon, 25 Sep 2023 00:00:00 +0000

PHP 8.1 readonly properties cannot be set from global space, but they can be forced from the host class, just like accessing private properties.
It doesn't work outside the host class : not in global space, not in a derived class.
Besides that, readonly act as usual : it is only possible to assign the property once.