|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40597 FILTER_VALIDATE_INT limited to system's signed integer size
Submitted: 2007-02-22 22:36 UTC Modified: 2007-02-22 22:48 UTC
From: mail957253 at lemurtastic dot com Assigned: pajoye (profile)
Status: Not a bug Package: Filter related
PHP Version: 5.2.1 OS: Windows XP SP2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: mail957253 at lemurtastic dot com
New email:
PHP Version: OS:


 [2007-02-22 22:36 UTC] mail957253 at lemurtastic dot com
FILTER_VALIDATE_INT should validate anything that normal people consider an integer as such, rather than being limited to what my computer can store in 32 bits.

Reproduce code:
filter_var('2147483648', FILTER_VALIDATE_INT);

Expected result:
returns '2147483648'

Actual result:
returns FALSE


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-22 22:48 UTC]
It returns a PHP integer which is limited to 32bits.

If you like to get a string containing a big integer, you can use the sanitize rule.

Once PHP has 64bits integer support, it will be available in filter as well.

Not a bug > bogus.
 [2012-03-15 02:33 UTC] php dot 20 dot rinogo at xoxy dot net
I'm with the OP.  I'm migrating an app from HostMonster shared hosting to a 
WiredTree VPS.

On HM, filter_var runs as expected (as stated above).  On WiredTree, it returns 

So, at BEST, PHP's behavior is inconsistent.
 [2013-01-24 04:50 UTC] spam at redfishbluefishdesign dot com
Ya, this is a bug.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Feb 25 03:01:28 2024 UTC