Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78629 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7640 invoked from network); 4 Nov 2014 11:50:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Nov 2014 11:50:37 -0000 Authentication-Results: pb1.pair.com header.from=are.you.winning@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=are.you.winning@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.49 as permitted sender) X-PHP-List-Original-Sender: are.you.winning@gmail.com X-Host-Fingerprint: 209.85.216.49 mail-qa0-f49.google.com Received: from [209.85.216.49] ([209.85.216.49:54899] helo=mail-qa0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F0/00-06676-C8DB8545 for ; Tue, 04 Nov 2014 06:50:36 -0500 Received: by mail-qa0-f49.google.com with SMTP id i13so9503032qae.8 for ; Tue, 04 Nov 2014 03:50:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=vn9eKfVP4BVjt9s81MBUdqovcM10L7GKZ/EPQW6+ocg=; b=RIyGAeOnedT3mZBi+RWT9Xa7tUbbGyRcVAnBbENRvnBZwfXePW1cLIRTQqH2nP9n9O qam3svA7dHZ6LsuvpswlNZRtdl8UAUNo6SjjU2PPkXFTCrZRAiyzntJzDjXmXK7q6Hgc jjSkbqtvdPOHOxeyZQrMv1KYbp+GHR0ctLKwciGdcPtCc6X0Cb5+tIVs1QK2ic/7P79K PRHFlog+kIEcX8G9c04Akol2fuQl/9kBK89mAU7Vp1M193UYoSufkC9snBqvcSHLpz3l N0xZMQKcX+WOlHbGj7MhkMOUXyKHON9S+vvXHQxSSE20Hm6b/C1lz96kDybCZ2ARDouY jMag== MIME-Version: 1.0 X-Received: by 10.140.42.135 with SMTP id c7mr10628582qga.7.1415101833567; Tue, 04 Nov 2014 03:50:33 -0800 (PST) Sender: are.you.winning@gmail.com Received: by 10.140.239.194 with HTTP; Tue, 4 Nov 2014 03:50:33 -0800 (PST) In-Reply-To: <0776A65F-D49A-4E8C-9771-6B5E5C4EA77E@ajf.me> References: <002601cff777$eb923430$c2b69c90$@tutteli.ch> <000601cff80a$972e0250$c58a06f0$@tutteli.ch> <5458937F.9020304@sugarcrm.com> <0776A65F-D49A-4E8C-9771-6B5E5C4EA77E@ajf.me> Date: Tue, 4 Nov 2014 11:50:33 +0000 X-Google-Sender-Auth: Fp_C_hNvNCXlBBqCDfTjMBY7U8U Message-ID: To: Andrea Faulds Cc: Stas Malyshev , Robert Stoll , PHP Internals Content-Type: multipart/alternative; boundary=001a1139838e1c63b3050707125d Subject: Re: AW: [PHP-DEV] Types on the right or on the left From: cw@daverandom.com (Chris Wright) --001a1139838e1c63b3050707125d Content-Type: text/plain; charset=UTF-8 On 4 November 2014 10:32, Andrea Faulds wrote: > > > On 4 Nov 2014, at 08:51, Stas Malyshev wrote: > > > > 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 the function name like parameter types do. > > So, in a sentence: In PHP, input types go on the left and output types go on the right. This sounds like a convention that could be established and followed, and no-one could reasonably call it inconsistent if it was adhered to. --001a1139838e1c63b3050707125d--