Re: Return type hints

From: Date: Mon, 07 Apr 2008 13:36:39 +0000
Subject: Re: Return type hints
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-36843@lists.php.net to get a copy of this message
Hello, Em Seg, 2008-04-07 às 10:15 -0300, Jarismar Chaves da Silva escreveu: > Or something like this would be nice too, please avoid using +<TYPE> > or (<TYPE>). > > class test { > public static Itest function testing($instance) { > return $instance; > } > } > > troels knak-nielsen wrote: > > On Mon, Apr 7, 2008 at 2:28 PM, Felipe Pena <felipensp@gmail.com> wrote: > > > > > class test { > > > static public function +Itest testing($instance) { > > > return $instance; > > > } > > > } > > > > > > > A more sane syntax, might be something like: > > > > class test { > > static function testing($instance) : Itest { > > return $instance; > > } > > } > > > > -- > > troels > > > > > -- > Jarismar Chaves da Silva As i said previously: > I really tried avoid this. > This is the reason for two notations. Actually 'integer', 'double', 'string', etc are allowed in function, class and interface names. Using only 1 notation, we would have that make them keywords. -- Regards, Felipe Pena.

« previous php.internals (#36843) next »