Pass a value into filter_input() using variable
Can anyone please explain, why do I get very strange warning: filter_input() expects parameter 1 to be long, string given when executing the code, that is part of my class and which seems perfectly fine: public static function Input($type, $data, $filter = 'FILTER_SANITIZE_SPECIAL_CHARS') { $type = 'INPUT_' . $type; return filter_input($type, $data, $filter); } In case I change it to, for example: return filter_input(INPUT_POST, $data, $filter); Then the warning goes to: filter_input() expects parameter 3 to be long . Everything works just fine if I use: return filter_input(INPUT_POST, $data,