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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sedat dot capar at isbank dot net dot tr
New email:
PHP Version: OS:

 

 [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 19:01:32 2025 UTC