Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78617 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76261 invoked from network); 4 Nov 2014 08:47:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Nov 2014 08:47:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@tutteli.ch; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=php@tutteli.ch; sender-id=pass Received-SPF: pass (pb1.pair.com: domain tutteli.ch designates 80.74.154.78 as permitted sender) X-PHP-List-Original-Sender: php@tutteli.ch X-Host-Fingerprint: 80.74.154.78 ns73.kreativmedia.ch Linux 2.6 Received: from [80.74.154.78] ([80.74.154.78:49885] helo=hyperion.kreativmedia.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F5/C3-24107-8B298545 for ; Tue, 04 Nov 2014 03:47:53 -0500 Received: (qmail 1217 invoked from network); 4 Nov 2014 09:47:47 +0100 Received: from cm56-129-238.liwest.at (HELO RoLaptop) (86.56.129.238) by ns73.kreativmedia.ch with ESMTPSA (AES128-SHA encrypted, authenticated); 4 Nov 2014 09:47:47 +0100 To: "'Andrea Faulds'" Cc: "'PHP Internals'" References: <002601cff777$eb923430$c2b69c90$@tutteli.ch> <68518A5F-4A11-4D93-914D-760A4CB447E8@ajf.me> In-Reply-To: <68518A5F-4A11-4D93-914D-760A4CB447E8@ajf.me> Date: Tue, 4 Nov 2014 09:47:46 +0100 Message-ID: <000701cff80c$02252b00$066f8100$@tutteli.ch> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQHFXQsvCqySdhOS5hZldA9wwvCKZAI0n7LwnFO4SIA= Content-Language: de-ch Subject: AW: [PHP-DEV] Types on the right or on the left From: php@tutteli.ch ("Robert Stoll") > -----Urspr=C3=BCngliche Nachricht----- > Von: Andrea Faulds [mailto:ajf@ajf.me] > Gesendet: Montag, 3. November 2014 16:40 > An: Robert Stoll > Cc: PHP Internals > Betreff: Re: [PHP-DEV] Types on the right or on the left >=20 >=20 > > On 3 Nov 2014, at 15:07, Robert Stoll wrote: > > > > It adds the type hint on the right hand side of the function (of the > > identifier). In contrast to parameters where the type hint is placed = on the left hand side of the identifier. > > Mixing both, having some types on the left and others on the right, > > seems like another inconsistency in the language design to me. >=20 > These inconsistencies exist for two reasons: >=20 > - Opposition to doing it the other way > - Hack already doing it this way >=20 > I don=E2=80=99t think `function void foo();` will happen, since = that=E2=80=99s been previously rejected as it breaks gripping for = =E2=80=9Cfunction foo=E2=80=9D. > Similarly, I don=E2=80=99t think `public $foo: Foo;` will happen, = given Hack does it as `public Foo $foo;`. >=20 > PHP doesn=E2=80=99t need more inconsistency, sure, but we must be = practical here. It is bad if PHP and Hack have the same feature > with different syntax, it will cause developer confusion and further = segment the communities. It is bad if we don=E2=80=99t get > return type hinting because the =E2=80=9Cconsistent=E2=80=9D syntax = would upset some people. >=20 > -- > Andrea Faulds > http://ajf.me/ >=20 I agree with you to a certain degree, PHP and Hack should not diverge = but (kind of but)... IMO Hack made a wrong language design decision and I do not see why PHP = should make the same mistake. And I am sure, Hack would catch up quickly = if PHP would decide to put all types on the right (as in the return type = hint RFC - just as an example).