Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81075 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59630 invoked from network); 24 Jan 2015 14:44:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jan 2015 14:44:24 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.174 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.174 mail-wi0-f174.google.com Received: from [209.85.212.174] ([209.85.212.174:43294] helo=mail-wi0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DE/31-49997-7CFA3C45 for ; Sat, 24 Jan 2015 09:44:24 -0500 Received: by mail-wi0-f174.google.com with SMTP id n3so2384002wiv.1 for ; Sat, 24 Jan 2015 06:44:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type:subject:from:date:to :message-id; bh=5mRPfLFeh+ctDjlrrArftGqPkqTlLKJJNOU66o7h/qk=; b=xWPf+rjDJRGPvkdFCqhtK9FkyYOTjLDGD+CSHu6Q8O5wJjYdnkEIJMheA7wHhDbLXy 4/wkiGuyC3Z2vKAhjjPChkxgVBeXXw3Vn7QZxP7FiLx4+nlGqfbrKyErQmf46zYjdQ1f 51KWhdIjX05hMhSYAHSMAc+zYesOJtTItr0Q+AyoSWkrWHSySk6eQ8vv7GADNS1h/jxD 089Lz3TqOI+CvLC/mTI2Td/A4nVm6Ag/+Rla5kT6JpPiN3ugTb2yfJia+b9iNFSuMqfP 7a6aZjMi/K20oPIfSCXl9vP8PB+mzMUAAa7Lmno7UDEAb6GlEUlxWEtZwddrbV4o+fOj ljgg== X-Received: by 10.194.60.205 with SMTP id j13mr25561741wjr.42.1422110659601; Sat, 24 Jan 2015 06:44:19 -0800 (PST) Received: from [192.168.0.3] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by mx.google.com with ESMTPSA id w3sm6500438wjf.3.2015.01.24.06.44.18 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 24 Jan 2015 06:44:18 -0800 (PST) User-Agent: K-9 Mail for Android In-Reply-To: <001801d037c6$2a7976c0$7f6c6440$@tutteli.ch> 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> <545917A2.6000206@lerdorf.com> <545977E1.2060700@sugarcrm.com> <54599A0F.2060400@sugarcrm.com> <001801d037c6$2a7976c0$7f6c6440$@tutteli.ch> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Date: Sat, 24 Jan 2015 14:42:16 +0000 To: Robert Stoll ,'PHP Internals' Message-ID: <4D7DEFFA-90BC-4117-956E-70B1A02A9C96@gmail.com> Subject: Re: [PHP-DEV] Types on the right or on the left From: rowan.collins@gmail.com (Rowan Collins) On 24 January 2015 11:09:04 GMT, Robert Stoll wrote: >Besides, pretty much the same impact has the return type RFC now, >because the manual should be updated accordingly to reflect the new >syntax IMO. Sounds like lot of work but it should be possible to >migrate the docs with a tool. As I said in another thread, updating the manual is nothing at all like changing the language. It is a single, centrally-controlled set of content, which doesn't have to be compatible with multiple environments, and has a minimum requirement of internal consistency which has been met in some cases with arbitrary conventions unrelated to the language. It may even be possible to change the notation without changing the source, by altering the output templates, but if not, an automated change to use a new convention more similar to new language syntax is a no-brainer. As for the rest, I don't see the pressing need to break a whole bunch of established syntax here. It will just make it impossible to run code under multiple versions, and brings a very minor benefit. I'm not even convinced that return types and parameter types are related enough to require consistency in an ideal world. The type hint to the left of a parameter is the type of that parameter, but a return type hint is not the type of the function - if the function were a first-class object, it's type would be "function", or a specific type such as "function(int, string): string". The function annotation means "produces a", not "is a". This isn't a theoretically rigorous argument, but to my mind it gives a sufficient reason for the syntaxes to be chosen independently. Regards, -- Rowan Collins [IMSoP]