Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93569 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65269 invoked from network); 26 May 2016 16:20:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 May 2016 16:20:15 -0000 Authentication-Results: pb1.pair.com header.from=fsb@thefsb.org; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=fsb@thefsb.org; spf=pass; 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:34566] helo=smtp91.iad3a.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A0/D8-17600-E3227475 for ; Thu, 26 May 2016 12:20:14 -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 C6A3A180612; Thu, 26 May 2016 12:20:11 -0400 (EDT) X-Auth-ID: fsb@thefsb.org Received: by smtp20.relay.iad3a.emailsrvr.com (Authenticated sender: fsb-AT-thefsb.org) with ESMTPSA id F0618180580; Thu, 26 May 2016 12:20:10 -0400 (EDT) X-Sender-Id: fsb@thefsb.org Received: from [10.0.1.2] (c-66-30-62-12.hsd1.ma.comcast.net [66.30.62.12]) (using TLSv1 with cipher DES-CBC3-SHA) by 0.0.0.0:465 (trex/5.5.4); Thu, 26 May 2016 12:20:11 -0400 User-Agent: Microsoft-MacOutlook/14.6.4.160422 Date: Thu, 26 May 2016 12:20:08 -0400 To: James Gilliland , Thomas Bley , , PHP Internals Message-ID: Thread-Topic: [PHP-DEV] [RFC][Vote] Typed Properties References: <20160525215208.034FC1A801B3@dd1730.kasserver.com> In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit Subject: Re: [PHP-DEV] [RFC][Vote] Typed Properties From: fsb@thefsb.org (Tom Worster) On 5/26/16, 11:02 AM, "James Gilliland" wrote: >Sarcasm aside, I still can't figure out how fundamentally changing how >people interact with uninitialized properties like this improves >developer experience. Can someone explain a case where this is better and >catches a bug or something? Since this is a new feature I would assume >its not covered by "BC" but this seems like a painful gotcha for people >developing across typed and untyped code. Talk of improving developer experiences is too subjective for me. I only want to say that one option we have is to require that a PHP property with a type declaration must also have an initial value declaration. This obviates some confusion, which is a good thing in my opinion. I understand that it will be surprising to some that the lazy old `public $var;` (that initializes to null if it is read before written to) is not available if you insert a type declaration. Such surprise will dissipate quickly if the compiler rejects such cases, one way or the other: either don't declare type or declare type plus initial value. If I'm wrong in this estimation and we in fact need to protect developers from the pain of this experience then I'd prefer to reject typed properties for the time being. Tom