Skip to content

filter_var extension should support FILTER_NULL_ON_FAILURE #1959

@iluuu1994

Description

@iluuu1994

A dynamic return type extension for filter_varwas recently added (#1900).

You can pass FILTER_NULL_ON_FAILURE to filter_var. In that case the function can also return null.

if (null !== $foo = filter_var($foo, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)) {
    // ...
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions