note 96058 deleted from function.filter-var by danbrown
| From: | danbrown@php.net | Date: | Fri, 05 Feb 2010 20:58:54 +0000 |
| Subject: | note 96058 deleted from function.filter-var by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-165698@lists.php.net to get a copy of this message | ||
Note Submitter: J Kraft
----
@Arvid
Your second example is incorrect/misleading...
This is actually telling you that --> '0' <-- is NOT a valid boolean...
In this example, you're asking if the string 0 is a boolean, which it is not:
filter_var('0', FILTER_VALIDATE_BOOLEAN);
We can see this by:
var_dump('0');
var_dump(0);
var_dump(false);
Which returns:
string(1) "0"
int(0)
bool(false)