Re: [RFC] [VOTE] Typed properties v2
| From: | Rowan Collins | Date: | Sun, 23 Sep 2018 20:07:56 +0000 |
| Subject: | Re: [RFC] [VOTE] Typed properties v2 | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-103239@lists.php.net to get a copy of this message | ||
On 23/09/2018 19:41, Claude Pache wrote:
We "must" forbid this IF we aim to guarantee that the object never has uninitialised properties; but the current consensus is that we can't make such a guarantee without changing a lot of other parts of the language. There are strong feelings that unset should be available for use in lazy-initialisation hacks, so this is likely to remain one of the back-doors which will let elephants in, unless and until someone comes up with a replacement for that hack. Regards, -- Rowan Collins [IMSoP]3) Object properties may be type hinted and the class author has until the end of the constructor to make sure they're fulfilled, otherwise TypeError on the spot (what I'm proposing).Just to be sure you don’t miss the herd that this elephant is concealing: In addition, you *must* forbid unset() on those properties...