#41030 [Opn->Bgs]: intval could not handle numbers bigger than 2,147,483,647

From: Date: Mon, 09 Apr 2007 17:22:45 +0000
Subject: #41030 [Opn->Bgs]: intval could not handle numbers bigger than 2,147,483,647
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-111242@lists.php.net to get a copy of this message
ID: 41030 Updated by: tony2001@php.net Reported By: sedat dot capar at isbank dot net dot tr -Status: Open +Status: Bogus Bug Type: Unknown/Other Function Operating System: windows PHP Version: 5.2.1 New Comment: intval() is bound to the limits of your system's integer. Previous Comments: ------------------------------------------------------------------------ [2007-04-09 17:21:37] 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:19:37] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41030&edit=1

« previous php.bugs (#111242) next »