Re: invalid params return value
| From: | Johannes Schlüter | Date: | Thu, 31 Dec 2009 13:22:08 +0000 |
| Subject: | Re: invalid params return value | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-46588@lists.php.net to get a copy of this message | ||
On Thu, 2009-12-31 at 12:20 +0000, Derick Rethans wrote:
> Hmm, I don't actually think many people test whether parsing parameters
> failed, but they do test the return value. AFAIK, our "standard" is to
> return NULL for parameter parsing failures (at least that's what all the
> examples in README.PARAMETER_PARSING_API do). I'd like to see that be
> the case for all things, but changing it now could be quite a bit of a
> BC break.
This is also the documented as the general convention:
http://de.php.net/manual/en/functions.internal.php
While there are exceptions to this on purpose: For instance get_object
is documented to "Return FALSE if /object/ is not an object" (this
exception was discussed in detail in the past)
johannes