Re: [RFC] Return type-hint
| From: | Johannes Schlüter | Date: | Thu, 28 Apr 2011 18:53:48 +0000 |
| Subject: | Re: [RFC] Return type-hint | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-52072@lists.php.net to get a copy of this message | ||
On Thu, 2011-04-28 at 20:04 +0200, Ferenc Kovacs wrote:
> > Why I need being "saved" from documenting my code properly? Anyway, the
> > function code defines the behavior, declaration of return type just ensures
> > function would fail in runtime if your code tries to return unexpected data
> > - but how is it helpful? The client of this function doesn't even know that
> > before actually calling it!
>
>
> why did we added ppp if people can define in the documentation(or in the
> method name :/) that which method is public and which isn't
with ppp i prevent the client code from doing something the
function/class author didn't expect. With this return hint the function
auther can force a runtime error when doing something wrong himself.
(which he has to check one way or the other using tests etc.)
johannes