Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103213 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 90815 invoked from network); 21 Sep 2018 12:17:51 -0000 Received: from unknown (HELO mail4.serversure.net) (185.153.204.203) by pb1.pair.com with SMTP; 21 Sep 2018 12:17:51 -0000 Received: (qmail 13413 invoked by uid 89); 21 Sep 2018 08:24:40 -0000 Received: by simscan 1.3.1 ppid: 13402, pid: 13408, t: 0.0432s scanners: attach: 1.3.1 clamav: 0.96/m:52/d:10677 Received: from unknown (HELO ?10.0.0.7?) (lester@lsces.co.uk@81.138.11.136) by mail4.serversure.net with ESMTPA; 21 Sep 2018 08:24:40 -0000 To: internals@lists.php.net References: Message-ID: Date: Fri, 21 Sep 2018 09:24:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2 From: lester@lsces.co.uk (Lester Caine) 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