[php-src] Issue #7894: filter_var("false", FILTER_VALIDATE_BOOL returns the set default value
| From: | TobiGr | Date: | Thu, 06 Jan 2022 10:22:51 +0000 |
| Subject: | [php-src] Issue #7894: filter_var("false", FILTER_VALIDATE_BOOL returns the set default value | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-238792@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/7894
Author: TobiGr
### Description
The following code:
```php
<?php
var_dump(filter_var("false", FILTER_VALIDATE_BOOLEAN, ['options' =>
['default '=> 2]]));
var_dump(filter_var("false", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
```
Resulted in this output:
``` php
int(2)
bool(false)
```
But I expected this output instead:
```php
bool(false)
bool(false)
```
Might be related: https://bugs.php.net/bug.php?id=49510
### PHP Version
7.4.27
### Operating System
Debian 4.19.208-1