php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41030 intval could not handle numbers bigger than 2,147,483,647
Submitted: 2007-04-09 17:19 UTC Modified: 2007-04-09 17:22 UTC
From: sedat dot capar at isbank dot net dot tr Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.2.1 OS: windows
Private report: No CVE-ID: None
 [2007-04-09 17:19 UTC] sedat dot capar at isbank dot net dot tr
Description:
------------
intval("2147483648") returns 214783648
this is upper limit for integers however we may use bigint in mysql
therefore converting numbers bigger than 214783647 is needed.


Reproduce code:
---------------
$sayi=intval("2147483648");
 
print number_format($sayi,",");

Expected result:
----------------
2,147,483,648

Actual result:
--------------
2,147,483,647

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-09 17:21 UTC] sedat dot capar at isbank dot net dot tr
I noticed that I made a mistake in first sentence of description
intval("2147483648") returns 214783648  

  should be 

intval("2147483648") returns 214783647
 [2007-04-09 17:22 UTC] tony2001@php.net
intval() is bound to the limits of your system's integer.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 14:01:33 2025 UTC