Doc #75096 [NEW]: FILTER_NULL_ON_FAILURE null for not only boolean
| From: | aaatoja at o2 dot pl | Date: | Sat, 19 Aug 2017 13:45:51 +0000 |
| Subject: | Doc #75096 [NEW]: FILTER_NULL_ON_FAILURE null for not only boolean | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-14899@lists.php.net to get a copy of this message | ||
From: aaatoja at o2 dot pl
Operating system: Debian
PHP version: 7.1.8
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:FILTER_NULL_ON_FAILURE null for not only boolean
Description:
------------
According to http://php.net/manual/en/filter.filters.flags.php
FILTER_NULL_ON_FAILURE is described as "Returns NULL for unrecognized
boolean values.", used with FILTER_VALIDATE_BOOLEAN.
But this flag also affects other, non-boolean, filters.
Test script:
---------------
var_dump(filter_var("123a", FILTER_VALIDATE_EMAIL,
FILTER_NULL_ON_FAILURE)); // null
var_dump(filter_var("123a", FILTER_VALIDATE_EMAIL)); // false
var_dump(filter_var("123a", FILTER_VALIDATE_INT,
FILTER_NULL_ON_FAILURE)); // null
var_dump(filter_var("123a", FILTER_VALIDATE_INT)); //false
var_dump(filter_var("123a", FILTER_VALIDATE_IP,
FILTER_NULL_ON_FAILURE)); // null
var_dump(filter_var("123a", FILTER_VALIDATE_IP)); //false
// etc
--
Edit bug report at https://bugs.php.net/bug.php?id=75096&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75096&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75096&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75096&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75096&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75096&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75096&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75096&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75096&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75096&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75096&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75096&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75096&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75096&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75096&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75096&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75096&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75096&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75096&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75096&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75096&r=mysqlcfg