Hi all, On Tue, Nov 4, 2014 at 12:39 AM, Andrea Faulds <a...@ajf.me> wrote:
> > On 3 Nov 2014, at 15:07, Robert Stoll <p...@tutteli.ch> 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’t think `function void foo();` will happen, since that’s been > previously rejected as it breaks gripping for “function foo”. Similarly, I > don’t think `public $foo: Foo;` will happen, given Hack does it as `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 yohg...@ohgaki.net