Bug #67167 [Com]: Wrong return value from FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE
| From: | infinitythe7th at gmx dot net | Date: | Sun, 04 May 2014 02:07:13 +0000 |
| Subject: | Bug #67167 [Com]: Wrong return value from FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-185612@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67167&edit=1
ID: 67167
Comment by: infinitythe7th at gmx dot net
Reported by: peter dot schultz at classmarkets dot com
Summary: Wrong return value from FILTER_VALIDATE_BOOLEAN,
FILTER_NULL_ON_FAILURE
Status: Open
Type: Bug
Package: *General Issues
Operating System: Fedora 20
PHP Version: 5.5.12
Block user comment: N
Private report: N
New Comment:
This bug seems to exists since version 5.4.8 as discussed here:
http://stackoverflow.com/questions/21469275/php-5-4-filter-var-filter-validate-boolean-bug-or-change-from-5-3
and being testable here:
http://3v4l.org/PB6sp
Previous Comments:
------------------------------------------------------------------------
[2014-05-01 11:40:50] peter dot schultz at classmarkets dot com
Description:
------------
---
From manual page: http://www.php.net/filter.filters.validate
---
FILTER_VALIDATE_BOOLEAN with the FILTER_NULL_ON_FAILURE flag return false if the first argument is
an object. According to the documentation it should be null.
Test script:
---------------
<?php
var_dump(filter_var(new \StdClass(), FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));'
Expected result:
----------------
NULL
Actual result:
--------------
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67167&edit=1