Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93565 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51348 invoked from network); 26 May 2016 13:38:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 May 2016 13:38:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=fsb@thefsb.org; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=fsb@thefsb.org; sender-id=pass Received-SPF: pass (pb1.pair.com: domain thefsb.org designates 173.203.187.91 as permitted sender) X-PHP-List-Original-Sender: fsb@thefsb.org X-Host-Fingerprint: 173.203.187.91 smtp91.iad3a.emailsrvr.com Linux 2.6 Received: from [173.203.187.91] ([173.203.187.91:46802] helo=smtp91.iad3a.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9F/A6-17600-04CF6475 for ; Thu, 26 May 2016 09:38:09 -0400 Received: from smtp20.relay.iad3a.emailsrvr.com (localhost.localdomain [127.0.0.1]) by smtp20.relay.iad3a.emailsrvr.com (SMTP Server) with ESMTP id CDF4B18035B; Thu, 26 May 2016 09:38:06 -0400 (EDT) X-Auth-ID: fsb@thefsb.org Received: by smtp20.relay.iad3a.emailsrvr.com (Authenticated sender: fsb-AT-thefsb.org) with ESMTPSA id 83CB6180413; Thu, 26 May 2016 09:38:06 -0400 (EDT) X-Sender-Id: fsb@thefsb.org Received: from yossy.local (c-66-30-62-12.hsd1.ma.comcast.net [66.30.62.12]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA) by 0.0.0.0:587 (trex/5.5.4); Thu, 26 May 2016 09:38:06 -0400 To: Stanislav Malyshev , internals@lists.php.net, Andrea Faulds References: <7B.12.14311.F79C5475@pb1.pair.com> <1b12b09f-f190-dca0-51d9-468e9c571268@fleshgrinder.com> <4ec823c6-b039-fc91-7c78-60d67719cd81@gmail.com> <00482771-3a07-06cf-ee8d-cd83a301c7e7@fleshgrinder.com> Cc: Marco Pivetta , Benoit Schildknecht , Niklas Keller Message-ID: <9fa3fd1c-643e-3d1e-e83a-51ccc7a7068e@thefsb.org> Date: Thu, 26 May 2016 09:38:06 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][Vote] Typed Properties From: fsb@thefsb.org (Tom Worster) On 5/25/16 6:03 PM, Stanislav Malyshev wrote: > Hi! > >> > Andrea already said that we would not use it for untyped properties, >> > hence, no BC. > Again, it's not that simple. Properties are not local. That means any > code that can deal with a class that may have typed properties (which > may be library class, for example, so you don't even know what it has > inside) has to deal with the possibility of it being of the new type. So > if the old code uses is_null($object->foo) as means to check if the > value wasn't initialized, and it's no longer null, then that code is > broken and needs to be rewritten. That's a BC break. Yes, it will never > happen if you never use typed properties, and never use any libraries > that might use typed properties, but then what's the point of the whole > thing? The point of BC is that if you don't use new features, you don't > have to change your code and it will keep working. With the proposed > solution, it won't be the case. > If you want, you can easily write a backwards-compatible new class that uses declared type properties with public int $property = null; I don't think loss of the (as yet hypothetical) lazy shortcut to write the same thing: public int $property; is BC break. Tom