Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81094 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94464 invoked from network); 24 Jan 2015 18:34:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jan 2015 18:34:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.51 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.216.51 mail-qa0-f51.google.com Received: from [209.85.216.51] ([209.85.216.51:41203] helo=mail-qa0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 13/E7-49997-6B5E3C45 for ; Sat, 24 Jan 2015 13:34:31 -0500 Received: by mail-qa0-f51.google.com with SMTP id f12so2162456qad.10 for ; Sat, 24 Jan 2015 10:34:28 -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:from:date:message-id :subject:to:cc:content-type; bh=EQ7OaxMaRzmX2tAlADVzoDjmHeA3l4kDwKD7/YlL7/4=; b=aNY7yJTE6zrjeIa87EYTxEHfBINI4qhMjyVeQmTiHw+qW0+kE3HJUSoeHlCxEVef6S LgRq3tPTx+Id+rA9xiDpkrqWOw6rinpwC2us9BgOIGbXgywg0Z0L43Zjx2gBpDvsRW0g zwQww26Pm5dooperXRvOIaaygjZGIvQ0EOg4isxs+4Bdj3nKKgupCtv6ymKuIIA4Je8z LmHx79GOPms8haD5ZCrHwJfKOR01y40yn5JgCKNUGVb4KefMqeXqgWxXOoAkQ2YxBoRf dapJXlPF7xUUzy2DLB7OEVuMn7yEFMype6hCzG3tZ4MqQWrphA4WhWQRCb6E7Tlx4Ubm +YDw== X-Received: by 10.140.97.203 with SMTP id m69mr25303051qge.39.1422124467876; Sat, 24 Jan 2015 10:34:27 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.229.93.70 with HTTP; Sat, 24 Jan 2015 10:33:47 -0800 (PST) In-Reply-To: <68518A5F-4A11-4D93-914D-760A4CB447E8@ajf.me> References: <002601cff777$eb923430$c2b69c90$@tutteli.ch> <68518A5F-4A11-4D93-914D-760A4CB447E8@ajf.me> Date: Sun, 25 Jan 2015 03:33:47 +0900 X-Google-Sender-Auth: u83NwlQJBKX2acmYZNnutr-h3Tc Message-ID: To: Andrea Faulds Cc: Robert Stoll , PHP Internals Content-Type: multipart/alternative; boundary=001a113a2aa2bc2bf0050d6a2774 Subject: Re: [PHP-DEV] Types on the right or on the left From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a113a2aa2bc2bf0050d6a2774 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi all, On Tue, Nov 4, 2014 at 12:39 AM, Andrea Faulds wrote: > > On 3 Nov 2014, at 15:07, Robert Stoll wrote: > > > > It adds the type hint on the right hand side of the function (of the > identifier). In contrast to parameters where the > > type hint is placed on the left hand side of the identifier. > > Mixing both, having some types on the left and others on the right, > seems like another inconsistency in the language > > design to me. > > These inconsistencies exist for two reasons: > > - Opposition to doing it the other way > - Hack already doing it this way > > I don=E2=80=99t think `function void foo();` will happen, since that=E2= =80=99s been > previously rejected as it breaks gripping for =E2=80=9Cfunction foo=E2=80= =9D. Similarly, I > don=E2=80=99t think `public $foo: Foo;` will happen, given Hack does it a= s `public > Foo $foo;`. > I agree with Andrea. There are people who dislike syntax, and/or thinks PHP missing check(i.e. array format, etc). These people should request DbC. DbC is more powerful than simple type checks and have no performance penalty in production. (I'm not saying type hinting is useless. I'll use it where it is appropriate, too.) I wish I have time for diving into Zend code, but it would not happen in short term. Therefore, I'm hoping someone to implement DbC :) Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a113a2aa2bc2bf0050d6a2774--