Re: Re: RE : [PHP-DEV] Return type hinting patch
| From: | Chris Stockton | Date: | Wed, 30 Apr 2008 16:26:31 +0000 |
| Subject: | Re: Re: RE : [PHP-DEV] Return type hinting patch | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-37361@lists.php.net to get a copy of this message | ||
Hello Sam.
Would you agree in general the function int name() { syntax is favored? If
you need help working out the grammar for such changes let me know. This is
something that I think would add value to PHP as a whole and would not mind
lending some time for.
-Chris
On Wed, Apr 30, 2008 at 4:51 AM, Sam Barrow <sam@sambarrow.com> wrote:
> On Wed, 2008-04-30 at 12:58 +0200, LAUPRETRE François (P) wrote:
> > > From: Stanislav Malyshev [mailto:stas@zend.com]
> >
> > > First is that function
> > > definition and code is usually written by the same person in the same
> > > (very small) context, and this person has to be somewhat
> > > absent-minded
> > > to forget what function returns from definition to return a
> > > dozen lines
> > > below. Supporting such absent-mindedness with language constructs
> > > doesn't appear appropriate.
> >
> > Right, return type hinting is useless in such cases, but it is
> interesting when we check whether a method is compatible with an implemented
> interface or an extended/abstract class. In this case, both codes are
> typically not written by the same person and specifying the methods' return
> types in an interface makes sense.
>
> This is my number one use, abstract methods that are later implemented.
>
> > Francois
> >
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>