FILTER_VALIDATE_INT doesn't allow minimum integer
| Bug #47745 | FILTER_VALIDATE_INT doesn't allow minimum integer | ||||
|---|---|---|---|---|---|
| Submitted: | 2009-03-21 23:34 UTC | Modified: | 2009-03-31 10:06 UTC | ||
| From: | for-bugs at hnw dot jp | Assigned: | dmitry (profile) | ||
| Status: | Closed | Package: | Filter related | ||
| PHP Version: | 5.2.9 | OS: | * | ||
| Private report: | No | CVE-ID: | None | ||
[2009-03-21 23:34 UTC] for-bugs at hnw dot jp
Description:
------------
Although -2147483648 is the minimum integer in 32bit environment,
FILTER_VALIDATE_INT says -2147483648 is invalid as integer.
Reproduce code:
---------------
<?php
var_dump(intval("-2147483648"));
var_dump(filter_var("-2147483648", FILTER_VALIDATE_INT));
Expected result:
----------------
int(-2147483648)
int(-2147483648)
Actual result:
--------------
int(-2147483648)
bool(false)
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2009-03-26 22:44 UTC] scottmac@php.net
[2009-03-29 16:43 UTC] iliaa@php.net
[2009-03-29 16:47 UTC] pajoye@php.net
[2009-03-29 21:38 UTC] scottmac@php.net
[2009-03-30 19:47 UTC] iliaa@php.net
[2009-03-31 09:27 UTC] for-bugs at hnw dot jp
[2009-03-31 10:06 UTC] dmitry@php.net