Re: bug #49510
| From: | Pierre Joye | Date: | Sun, 15 Jul 2012 19:27:54 +0000 |
| Subject: | Re: bug #49510 | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-61252@lists.php.net to get a copy of this message | ||
hi!
On Sun, Jul 15, 2012 at 7:57 AM, Stas Malyshev <smalyshev@sugarcrm.com> wrote:
> Hi!
>
> We've got a bit of a discussion on bug #49510 in the comments. The
> problem is this: filter_var('', FILTER_VALIDATE_BOOLEAN, array("flags"
> => FILTER_NULL_ON_FAILURE)) returns "null" (i.e. failure) while docs say
> boolean filter will return false on ''. I think we need to sync with the
> docs.
> The question is - should we apply it to 5.3/5.4? It is a behavior
> change, even though current code behavior does not match documented
> behavior.
The question is more about the correctness of the doc, and to what I
remember (I implemented that NULL on failure thing), the doc is wrong.
And the null on failure was mainly implemented for this exact case
(boolean validation).
Cheers,
--
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org