#43018 [Opn->Ver]: filter_var() does not support arrays as implied by the documentation
| From: | philip@php.net | Date: | Thu, 18 Oct 2007 13:18:15 +0000 |
| Subject: | #43018 [Opn->Ver]: filter_var() does not support arrays as implied by the documentation | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-146@lists.php.net to get a copy of this message | ||
ID: 43018
Updated by: philip@php.net
Reported By: lsmith@php.net
-Status: Open
+Status: Verified
Bug Type: Documentation problem
Operating System: Irrelevant
PHP Version: Irrelevant
New Comment:
Was it once going to work with arrays but then filter_var_array() was
created instead? This seems to be the case, and your code example
confirms it ;-)
Previous Comments:
------------------------------------------------------------------------
[2007-10-18 11:46:27] lsmith@php.net
Description:
------------
The documentation for filter_var
(http://php.net/manual/en/function.filter-var.php) implies that array's
are filtered recursively:
"Value to filter, arrays are filtered recursively."
However passing any array returns false
Reproduce code:
---------------
var_dump(filter_var_array(array('foo', array('bar')),
FILTER_UNSAFE_RAW));
Expected result:
----------------
array
0 => string 'foo' (length=3)
1 =>
array
0 => string 'bar' (length=3)
Actual result:
--------------
false
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43018&edit=1