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

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

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

google shop client API returns 400 bad request error while adding an item -