go to bug id or search bugs for
Bug report #47752
var_dump(filter_var('-0',FILTER_VALIDATE_INT)); // bool(false)
var_dump(-0); // int(0)
In my opinion FILTER_VALIDATE_INT must work like var_dump(-0);
Sooner or later we will get problems if everything works different.
PHP defines -0 as an int. So FILTER_VALIDATE_INT must also accept -0 and +0.
Add a Patch
Add a Pull Request
It would also be nice if anybody would care about http://bugs.php.net/bug.php?id=53775
The PR in https://github.com/php/php-src/pull/248 addresses this issue.
The fix for this bug has been committed.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.