Re: Request for comments - new PHP feature: return typing
| From: | Johannes Schlüter | Date: | Wed, 26 Jun 2013 14:48:55 +0000 |
| Subject: | Re: Request for comments - new PHP feature: return typing | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-67877@lists.php.net to get a copy of this message | ||
On Wed, 2013-06-26 at 16:40 +0200, Ferenc Kovacs wrote:
> >
> I think that the return typehints a bit easier topic than the input type
> hinting(for scalars), because that affects the caller, while return type
> hinting is more contained: you write the function, you put the return
> typehint there, if the method tries to return something else, then your
> code is at fault.
> So even if we would allow return typehints for scalars that would only
> affects those functions where the developer opts-in.
So a function author doesn't trust himself and therefore we change the
language syntax?
johannes