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 -

android - IBM Worklight 6.1 [Application Error] There was a network error (file:///android_asset/www/index.html) -