Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92001 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52194 invoked from network); 30 Mar 2016 00:59:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Mar 2016 00:59:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=derokorian@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=derokorian@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.175 as permitted sender) X-PHP-List-Original-Sender: derokorian@gmail.com X-Host-Fingerprint: 209.85.214.175 mail-ob0-f175.google.com Received: from [209.85.214.175] ([209.85.214.175:36579] helo=mail-ob0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 31/DA-24137-FF42BF65 for ; Tue, 29 Mar 2016 19:59:43 -0500 Received: by mail-ob0-f175.google.com with SMTP id m7so36019745obh.3 for ; Tue, 29 Mar 2016 17:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=Q6M8fIcbIgkLixjLcK19qgmpFRwAlRNRzt2aHGWFfns=; b=AlE+fwreQYnc66/YW8kC9WAh0U5bJ0D3NSXy4+MBBbBLyWb6hwT18hU2isYeMOMCR/ zixrMjdCyBGf/TTJ/yVWPRg/GUy6GLbyZoR93rR3s9Wjq5M8Tzxiq66bkniy0iIbOXKW 6ekfLJDKdvp9dnCAiS+RgdkdehAHB6Qlz7eiraQhnMrR0GlKX5PFvl3N5bBtKKgtvAn3 mWKZuTUu7+ZgkS5NYXlpprM8BobJt1vcWcaMNrlsZcQeCdLO+/ayWwgklb+12hccrZmg vaC562OONX77QOIz8Z+5uyrdJZ39Gh57Xar1hQm+u8u3WOzlRXLSHySU/Co81wbsyOEo fO5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=Q6M8fIcbIgkLixjLcK19qgmpFRwAlRNRzt2aHGWFfns=; b=glLpjW9J6G0Ekk6gPaee6Q66Ba2Ge/CfYwbyB9qRm05+IWvkMmn95ximcS3EhL0OWN rrPJCqjjdZEnaDucU4UXUl3xYdQA5RHZtYNeMzeoCsvDuWRN9PVynsEYs2FT8EBdkC9v RFr/rta5pBEcO5+/MHRRn7Hc6SageTVrDqcVKaqUPoyFSaHRSwDYA7qCZPAK56qpz/9x wsrUCduhWDRBcHDInL7d9zhhn65KDyxcKr3g7USgDvb4nURxiKtNwD1E4/8CQzSwyY33 nFJiVjwjvbZNrWXz8McOibo0v8sR3hNvPeARmxQWAbfHcpZLlW26zWlYLWDEpU42/H43 ZtjQ== X-Gm-Message-State: AD7BkJKKixWRsU/DfFb/71oE/AYArSEbOoRQqiwvnqKzIFz8aLP70hA490YM3yVPOf3pCzSDU3Q+hzH265O2NA== MIME-Version: 1.0 X-Received: by 10.157.16.19 with SMTP id h19mr149212ote.181.1459299580119; Tue, 29 Mar 2016 17:59:40 -0700 (PDT) Received: by 10.157.4.200 with HTTP; Tue, 29 Mar 2016 17:59:39 -0700 (PDT) In-Reply-To: References: <1458149992.3969.2.camel@kuechenschabe> <1458151531.3969.8.camel@kuechenschabe> <1458153695.3969.16.camel@kuechenschabe> <3F.70.02405.6803BE65@pb1.pair.com> <56F01545.8080008@gmail.com> <56F14572.701@gmail.com> <56F15EF5.80006@telia.com> <56F16023.1010002@gmail.com> Date: Tue, 29 Mar 2016 18:59:39 -0600 Message-ID: To: Levi Morrison Cc: Dmitry Stogov , Joe Watkins , Phil Sturgeon , "krakjoe@php.net" , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a113e23681810e9052f39a931 Subject: Re: [PHP-DEV] [RFC Discussion] Typed Properties From: derokorian@gmail.com (Ryan Pallas) --001a113e23681810e9052f39a931 Content-Type: text/plain; charset=UTF-8 On Tue, Mar 29, 2016 at 5:16 PM, Levi Morrison wrote: > > 2) The handling of multiple properties in the same declaration statement > is inconsistent. > > > > public int $bar, string $qux; // this works > > > > public int $bar, $qux; //this emits error: Untyped property > A::$qux must not be mixed with typed properties > > > > It's better to allow type only before first property in the list and > apply them to all of them (like C, Java and others). > > Is this just an implementation issue? > > I'm actually glad this is prevented because it's confusing. Is `$qux` > typed or untyped? > I think its very obviously typed int. This would allow you to list a bunch of things of the same type in a single declaration, meaning only a single visibility and type for the line, instead of having to repeat the type for each property (whilst not having to repeat the visibility, this feels inconsistent). public string $firstName, $middleInitial, $lastName, $nickName; vs public string $firstName, string $middleInitial, string $lastName, string $nickName; I like the first much better personally. The second feels inconsistent, why would the visibility carry to all properties but not the type? > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a113e23681810e9052f39a931--