hi! On Sun, Jul 15, 2012 at 7:57 AM, Stas Malyshev <smalys...@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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php