Re: RFC: Locked Classes
| From: | Rowan Collins | Date: | Sun, 10 Mar 2019 20:19:45 +0000 |
| Subject: | Re: RFC: Locked Classes | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-104633@lists.php.net to get a copy of this message | ||
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]