You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
filter_var() with a bool and FILTER_VALIDATE_DOMAIN / FILTER_VALIDATE_REGEXP is inferred as false #14125
filter_var() with a bool input and FILTER_VALIDATE_DOMAIN or FILTER_VALIDATE_REGEXP is inferred as false, but PHP converts the bool to a string first (true → '1', false → '') and filters that.
Cause: the FILTER_VALIDATE_DOMAIN and FILTER_VALIDATE_REGEXP branches of FilterUtils::getReturnType() have no TBool handling, so a bool only sets $can_fail.
Psalm output (using commit a32c0d4):
INFO: Trace - 4:5 - $a: false
INFO: Trace - 6:5 - $c: false
INFO: Trace - 8:5 - $d: false
INFO: Trace - 10:5 - $e: false
INFO: UnusedVariable - 4:5 - $a is never referenced or the value is not used
INFO: UnusedVariable - 6:5 - $c is never referenced or the value is not used
INFO: UnusedVariable - 8:5 - $d is never referenced or the value is not used
INFO: UnusedVariable - 10:5 - $e is never referenced or the value is not used
INFO: MissingReturnType - 2:10 - Method f does not have a return type, expecting void
Activity
psalm-github-bot commentedon Nov 17, 2026
I found these snippets:
https://psalm.dev/r/08f9458f66
fix(filter_var): bools, empty literals and FILTER_FLAG_EMPTY_STRING_N…