Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74023 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85389 invoked from network); 7 May 2014 17:35:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 May 2014 17:35:01 -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 198.187.29.233 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 198.187.29.233 imap1.ox.registrar-servers.com Received: from [198.187.29.233] ([198.187.29.233:47980] helo=imap1.ox.registrar-servers.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D7/A4-56552-3CE6A635 for ; Wed, 07 May 2014 13:35:00 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 7A1EF2000B0; Wed, 7 May 2014 13:34:56 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap1.ox.registrar-servers.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap1.ox.registrar-servers.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id VkECjhlChIHY; Wed, 7 May 2014 13:34:56 -0400 (EDT) Received: from [192.168.0.200] (unknown [2.218.135.6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 1F3972000B1; Wed, 7 May 2014 13:34:53 -0400 (EDT) Content-Type: multipart/alternative; boundary="Apple-Mail=_1E89F60B-F3E7-46CD-A99B-03AA11EBBE03" Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) In-Reply-To: Date: Wed, 7 May 2014 18:34:50 +0100 Cc: Larry Garfield , "internals@lists.php.net" Message-ID: References: <535E9AED.2080904@garfieldtech.com> <535ECB9E.5050701@garfieldtech.com> <535FC0DE.5050709@garfieldtech.com> To: Lin Yo-An X-Mailer: Apple Mail (2.1874) Subject: Re: [PHP-DEV] [RFC] Return Type Declarations From: ajf@ajf.me (Andrea Faulds) --Apple-Mail=_1E89F60B-F3E7-46CD-A99B-03AA11EBBE03 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On 7 May 2014, at 18:02, Lin Yo-An wrote: > Why using an additional ":" symbol for the return type? what about > considering this: >=20 > function foo() string { } >=20 > and for closure: >=20 > $bar =3D 1; > $foo =3D function() use ($bar) string { >=20 > }; >=20 > I think removing ":" symbol is cleaner. Presumably it=92s because TypeScript, ActionScript and Hack already use = the `function foo() : type` form, so it=92s a familiar syntax. However, = Go uses the `func foobar() type` form, so there=92s also precedent for = that one. Considering the audience of PHP, TypeScript, ActionScript and = Hack are probably more familiar than Go. Maybe there=92s a technical reason for it, though. -- Andrea Faulds http://ajf.me/ --Apple-Mail=_1E89F60B-F3E7-46CD-A99B-03AA11EBBE03--