php.net |  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
 [2007-02-22 22:36 UTC] mail957253 at lemurtastic dot com
Description:
------------
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-22 22:48 UTC] pajoye@php.net
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 
false.

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: Tue Apr 23 20:01:29 2024 UTC