Re: return false if error
| From: | Derick Rethans | Date: | Wed, 19 Mar 2014 12:17:07 +0000 |
| Subject: | Re: return false if error | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969384879@lists.php.net to get a copy of this message | ||
On Tue, 18 Mar 2014, Robert Stoll wrote:
> Heya,
>
> We were discussing the scenario where a function returns false in an error case in a thread on
> the general mailing list.
> I always thought the documentation would use mixed as return type in such a situation (like in
> strpos) but others
> disagreed.
>
> For instance, Mike Ford told me:
> > It has always been policy in the documentation to specify only the substantive return
> > type(s) of a function
> > in the signature, and only mention return of "false" as an error indicator in
> > the description. There are
> > many, many examples of this in the manual, and I think it's unlikely the policy will
> > change any time soon.
>
> So my question is, what is your opinion on that topic?
>
> I already committed two patches to change the return type to mixed, since the functions also
> return false.
> I could revert them (or discard the commit, I do not know if this is possible - was made
> through edit.php.net).
I am against changing the current policy.
cheers,
Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
Posted with an email client that doesn't mangle email: alpine