Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78668 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98001 invoked from network); 4 Nov 2014 18:40:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Nov 2014 18:40:43 -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.216 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.216 imap10-3.ox.privateemail.com Received: from [192.64.116.216] ([192.64.116.216:35093] helo=imap10-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C4/90-06676-AAD19545 for ; Tue, 04 Nov 2014 13:40:42 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 900122400D3; Tue, 4 Nov 2014 13:40:39 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap10.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap10.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZewNgVxI8xKn; Tue, 4 Nov 2014 13:40:39 -0500 (EST) Received: from oa-edu-170-172.wireless.abdn.ac.uk (oa-edu-170-172.wireless.abdn.ac.uk [137.50.170.172]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 0CBBA2400EA; Tue, 4 Nov 2014 13:40:37 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) In-Reply-To: <54591BEF.6050007@sugarcrm.com> Date: Tue, 4 Nov 2014 18:40:35 +0000 Cc: Robert Stoll , PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <002601cff777$eb923430$c2b69c90$@tutteli.ch> <000601cff80a$972e0250$c58a06f0$@tutteli.ch> <5458937F.9020304@sugarcrm.com> <545910F1.8030904@sugarcrm.com> <859A97F0-7C58-406A-857B-557F8AA657AD@ajf.me> <54591BEF.6050007@sugarcrm.com> To: Stas Malyshev 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 4 Nov 2014, at 18:33, Stas Malyshev wrote: >=20 >> If we used this syntax instead, which wouldn=E2=80=99t disrupt grep: >>=20 >> public Foo function bar(); >>=20 >> It=E2=80=99d be inconsistent with normal function declarations which = would have to have Foo after function. >=20 > What's "normal function" and why it would have to have "Foo" after > function? What's wrong with "Foo function bar()"? It reads nicely (at > least in English, where the natural word order is adjective-noun, not > noun-adjective), it does not disrupt any searches, what exactly is = wrong > with it? I suppose it=E2=80=99s alright for normal functions: Foo function foo() { } But it=E2=80=99s rather weird for closures: $foo =3D Foo function () { }; It=E2=80=99s probably doable from a parsing perspective, but it seems = really off to me. Having this return type at the start of the expression = doesn=E2=80=99t make sense to me. But this whole discussion is a little pointless given it=E2=80=99s not = what will actually be in PHP. -- Andrea Faulds http://ajf.me/