Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78580 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51057 invoked from network); 3 Nov 2014 15:39:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Nov 2014 15:39:53 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.208 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.208 imap2-3.ox.privateemail.com Received: from [192.64.116.208] ([192.64.116.208:36216] helo=imap2-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 60/E5-08476-9C1A7545 for ; Mon, 03 Nov 2014 10:39:53 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id BFA6C8C0081; Mon, 3 Nov 2014 10:39:49 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap2.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap2.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id TkRoVARj0cKV; Mon, 3 Nov 2014 10:39:49 -0500 (EST) Received: from oa-res-26-28.wireless.abdn.ac.uk (oa-res-26-28.wireless.abdn.ac.uk [137.50.26.28]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 1F2CE8C0080; Mon, 3 Nov 2014 10:39:48 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) In-Reply-To: <002601cff777$eb923430$c2b69c90$@tutteli.ch> Date: Mon, 3 Nov 2014 15:39:46 +0000 Cc: PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: <68518A5F-4A11-4D93-914D-760A4CB447E8@ajf.me> References: <002601cff777$eb923430$c2b69c90$@tutteli.ch> To: Robert Stoll X-Mailer: Apple Mail (2.1990.1) Subject: Re: [PHP-DEV] Types on the right or on the left From: ajf@ajf.me (Andrea Faulds) > On 3 Nov 2014, at 15:07, Robert Stoll wrote: >=20 > 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. These inconsistencies exist for two reasons: - Opposition to doing it the other way - Hack already doing it this way 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;`. 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. -- Andrea Faulds http://ajf.me/