Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93512 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95892 invoked from network); 25 May 2016 16:03:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 May 2016 16:03:31 -0000 X-Host-Fingerprint: 137.50.159.218 oa-edu-159-218.wireless.abdn.ac.uk Received: from [137.50.159.218] ([137.50.159.218:21336] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F7/23-14311-2DCC5475 for ; Wed, 25 May 2016 12:03:31 -0400 Message-ID: To: internals@lists.php.net References: <80.72.63510.DAFA5475@pb1.pair.com> <68fd73e7-ad19-3758-7b7a-6013cc26385f@gmail.com> Date: Wed, 25 May 2016 17:03:27 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:43.0) Gecko/20100101 Firefox/43.0 SeaMonkey/2.40 MIME-Version: 1.0 In-Reply-To: <68fd73e7-ad19-3758-7b7a-6013cc26385f@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 137.50.159.218 Subject: Re: [PHP-DEV] [RFC][Vote] Typed Properties From: ajf@ajf.me (Andrea Faulds) Hi Stas, Stanislav Malyshev wrote: > Hi! > >> * uninitialised - the constructor (or indeed, other code) is yet to set it >> * null - the property is left intentionally empty > > For declared properties, this always has been the same, and I'm not sure > why would we want to change that. This also has a potential to be a huge > BC break if we change it not to be the same, since pretty much all the > code assumes it is the same. We'd essentially have to invent another > null, which is exactly the same as null but isn't null. I don't see a > reason to do this. It'd be a BC break if we changed untyped properties' behaviour, yeah. We wouldn't be inventing a new null, though, we'd be leaving the property undefined until it's initialised, which we already have support for (properties, and indeed all variables can be unset()). > >> * some other value - the property is intentionally given a value >> >> A simple example might be a Lisp-style linked list cell: >> >> class LinkedList >> { >> public int $head; >> public ?LinkedList $tail; >> } >> >> In a properly initialised LinkedList, the $head is some value, and the >> $tail is either another linked list (the remainder of the list), or null >> (we're at the end of the list). > > This is a very weird list, as it can't be empty. The empty list is represented by null in this arrangement. Thanks. -- Andrea Faulds https://ajf.me/