wondering whether there is a reason for readonly properties in #php can not be initialized from global scope

anyone got a clue ?

Follow

@dgoosens
wiki.php.net/rfc/readonly_prop :
"There is currently no way to make a property readable to everyone and writeable only to the containing object, with PHP's visibility specifiers allowing all or nothing: a scope can either both read and write, or do neither. While __get and __set exist, these do not actually allow control of the same property, merely only exposing a separate property, and they are only usable for undeclared properties, which cannot be reflected and are not performant."

Sign in to participate in the conversation
Fosstodon

Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.