php filter_var fails with zero on FILTER_VALIDATE_INT -


i'm confused following throws exception:

if (!filter_var(0, filter_validate_int))     throw new exception("non numeric field passed " . $field . " when expecting number: " . $variable . " passed instead"); 

anything positive works fine? i've tried intval(0) , still nothing. 0 not integer?

filter_var returns filtered data, or false if filter fails.

filter_var(0, filter_validate_int) returns int(0), , falsy value, !filter_var(0, filter_validate_int) true.


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -