Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78654 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76003 invoked from network); 4 Nov 2014 17:51:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Nov 2014 17:51:49 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.91 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.91 smtp91.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.91] ([108.166.43.91:58944] helo=smtp91.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/EB-06676-43219545 for ; Tue, 04 Nov 2014 12:51:49 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp4.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 46C561809C5; Tue, 4 Nov 2014 12:51:46 -0500 (EST) X-Virus-Scanned: OK Received: by smtp4.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id CE6F9180996; Tue, 4 Nov 2014 12:51:45 -0500 (EST) X-Sender-Id: smalyshev@sugarcrm.com Received: from Stass-MacBook-Pro.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net [108.66.6.48]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA) by 0.0.0.0:465 (trex/5.3.2); Tue, 04 Nov 2014 17:51:46 GMT Message-ID: <54591231.1030801@sugarcrm.com> Date: Tue, 04 Nov 2014 09:51:45 -0800 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Andrea Faulds CC: Robert Stoll , PHP Internals References: <002601cff777$eb923430$c2b69c90$@tutteli.ch> <000601cff80a$972e0250$c58a06f0$@tutteli.ch> <5458937F.9020304@sugarcrm.com> <0776A65F-D49A-4E8C-9771-6B5E5C4EA77E@ajf.me> In-Reply-To: <0776A65F-D49A-4E8C-9771-6B5E5C4EA77E@ajf.me> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: AW: [PHP-DEV] Types on the right or on the left From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > I thought it was inconsistent, but after discussions on > StackOverflow, I don't think it actually is. If you specify the type once as "Foo something" and once as "something: Foo" then I don't see how there's even a place for discussions that it's inconsistent. > Return types describe the return type of a function, not the type of > a function. Given that in PHP functions do not have types, not being objects of the language, this seems to be argument invented just to ignore the inconsistency. Moreover, in languages where functions do have types - e.g. ML for example - the return of the function is specified in exactly the same manner as parameter type, and type of the function itself is never specified explicitly, but if needed, it is referred to with different syntax (->). See: https://en.wikipedia.org/wiki/Standard_ML Same situation with ActionScript: https://en.wikipedia.org/wiki/ActionScript both parameters and return type use ":" and nobody thinks that specifies type of the function - as, again, nobody ever specifies type of the function as such. In fact, I can remember no language that would specify type of the function (as opposed to parameters + returns) when declaring a function, even among languages with first class functions. > Also, it's worth bearing in mind that `public Foo function` was > rejected previously. Many things were rejected previously, but the RFC does not bring any argument about it and never even mentions it as far as I can see. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/