On 23/09/2018 21:50, Christoph M. Becker wrote:
In my opinion, explicitly *declared* properties should not be
unsettable.  We don't allow to undefine constants, functions, classes
etc. either.  Adding and removing other properties could still be allowed.


While I agree, I think that's a somewhat separate discussion: right now, you can unset() a declared property, and that is handled differently from setting it to null. Weird though it is, there is widely-used code which actively relies on this fact, so it's not something we can just "fix".

The solution might be some way of marking a class as "completely specified" - no dynamic properties may be added, no declared properties may be unset; but like I say, that's a separate discussion.

Regards,

--
Rowan Collins
[IMSoP]


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to