On 10/03/2019 19:46, Marco Pivetta wrote:
@rowan: I've stated it multiple times in the past, but if the mechanism is to be removed, then it should be replaced with a language-level concept of laziness then.
1) I'm all for adding a language-level concept of laziness. It feels like it could fit with a syntax for getters and setters, which has been discussed a few times, but never quite made it.
2) I'm not saying that the current behaviour should be removed, I'm saying that dynamically unsetting properties is inherently incompatible with declaring a class "locked".
I've actually had more than one suggestion that __get(), __set(), and __unset() should not be allowed at all on locked classes; in which case, it wouldn't matter how unset() behaved, because the lazy-loading trick relies on __get() as well.
Regards, -- Rowan Collins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php