>
> If somebody really wants a `mixed` property to be immutable, they could
> write `private immutable null|bool|int|float|string|array|object
> $property;`.
>

Yeah, one of my ideas was to first add support for mixed (for which there
have been a proposal/PR since quite some time), so that all non-typed
properties
could be implicitly upgraded to the mixed type. But I don't think it's the
way to go... Maybe only if our long-term goal would be to deprecate/remove
non-typed properties and implicit initialization altogether in favour of
mixed type and implicit uninitialization...


> That would make implementation straightforward, since you'd expect
> `immutable` to be before a type declaration (can be done in the parser,
> right?).
>

Yeah, the implementation didn't seem very tricky yet (but people with more
experience with the internals of PHP should tell). However, Nikita also
warned me
not to support references. So this is another question to decide...

Reply via email to