Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78624 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91677 invoked from network); 4 Nov 2014 10:32:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Nov 2014 10:32:52 -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:53222] helo=imap2-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C4/C0-20556-15BA8545 for ; Tue, 04 Nov 2014 05:32:50 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 7CA618C007D; Tue, 4 Nov 2014 05:32:47 -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 DD6tYcMJgDlN; Tue, 4 Nov 2014 05:32:47 -0500 (EST) Received: from [137.50.30.219] (oa-res-30-219.wireless.abdn.ac.uk [137.50.30.219]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 75CB98C0080; Tue, 4 Nov 2014 05:32:44 -0500 (EST) References: <002601cff777$eb923430$c2b69c90$@tutteli.ch> <000601cff80a$972e0250$c58a06f0$@tutteli.ch> <5458937F.9020304@sugarcrm.com> Mime-Version: 1.0 (1.0) In-Reply-To: <5458937F.9020304@sugarcrm.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-ID: <0776A65F-D49A-4E8C-9771-6B5E5C4EA77E@ajf.me> Cc: Robert Stoll , PHP Internals X-Mailer: iPhone Mail (12B411) Date: Tue, 4 Nov 2014 10:32:41 +0000 To: Stas Malyshev Subject: Re: AW: [PHP-DEV] Types on the right or on the left From: ajf@ajf.me (Andrea Faulds) > On 4 Nov 2014, at 08:51, Stas Malyshev wrote: >=20 > I agree, this is not a very good situation. It would be much better to > take a systematic approach to this, but this is impossible since there > is no systematic approach to strict typing in PHP, just some pieces here > and there. I think this is not right, but obviously many people here > disagree and are happy to have the inconsistent syntax. I don't see why > "public Foo function bar()" would be so much worse than "public function > bar() : Foo" but for some reason this possibility wasn't even > considered as far as I can see. I thought it was inconsistent, but after discussions on StackOverflow, I don= 't think it actually is. Return types describe the return type of a function= , not the type of a function. So there's no reason they have to go before th= e function name like parameter types do. Also, it's worth bearing in mind that `public Foo function` was rejected pre= viously. -- Andrea Faulds http://ajf.me/=