I am testing a function for PHP value filter called filter_var()
. And a of your filters , focused on int
values seems to accept any combination of numbers, +
and -
. Example:
filter_var("1teste2", FILTER_SANITIZE_NUMBER_INT) // 12
filter_var("1-teste-2", FILTER_SANITIZE_NUMBER_INT) // 1--2
filter_var("1--1--+--1", FILTER_SANITIZE_NUMBER_INT) // 1--1--+--1
Is this normal behavior? Does the language accept this type of value as int
with no problems, or is it a bug of the filter function?