3 ms·
The readonly property in PHP would fit the bill quite well as it can be set once and only once, no? Plus the new PHP 8.4 version actually has asymmetric visibi
by cardanome 2y ago
The readonly property in PHP would fit the bill quite well as it can be set once and only once, no?
Plus the new PHP 8.4 version actually has asymmetric visibility for properties so you can have public properties that can not be mutated from the outside but still allow controlled mutation on the inside. The feature was borrowed from swift. I am super excited about it.
https://wiki.php.net/rfc/asymmetric-visibility-v2 https://wiki.php.net/rfc/asymmetric-visibility-v2