Re: [RFC] [VOTE] Typed properties v2
| From: | Lester Caine | Date: | Fri, 21 Sep 2018 08:24:39 +0000 |
| Subject: | Re: [RFC] [VOTE] Typed properties v2 | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-103213@lists.php.net to get a copy of this message | ||
On 21/09/2018 08:58, Rasmus Schultz wrote:
No matter how you twist it, uninitialized is the new null. I'm fine with unintialized as an implementation detail that ensures you can't read from properties while the constructor is busy establishing the invariant. I'm not at all fine with unintialized as a new language feature.Ignoring the debate on uninitialized/null ... not all objects ARE invariant and there are very good reasons for not setting values for everything, but it seems that these types of object are deemed to be 'bad coding' where in fact the simply have elements that yet to be 'initialized' if at all for this instance of the object. The constructor simply creates those elements that need to exit and does nothing with the holders for elements that have yet to be populated ... they stay null. -- Lester Caine - G8HFL ----------------------------- Contact - https://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - https://lsces.co.uk EnquirySolve - https://enquirysolve.com/ Model Engineers Digital Workshop - https://medw.co.uk Rainbow Digital Media - https://rainbowdigitalmedia.co.uk