#47718 [NEW]: Integers overflow for 64 bit platform

From: Date: Thu, 19 Mar 2009 14:46:46 +0000
Subject: #47718 [NEW]: Integers overflow for 64 bit platform
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-2006@lists.php.net to get a copy of this message
From:             vivekanandan8 at yahoo dot com
Operating system: all os
PHP version:      Irrelevant
PHP Bug Type:     Documentation problem
Bug description:  Integers overflow for 64 bit platform

Description:
------------
Documentation for 64 bit platform about integers overflow 

Reproduce code:
---------------
---
From manual page: language.types.integer
---


Expected result:
----------------
If PHP encounters a number beyond the bounds of the integer type, it will
be interpreted as a float instead. 
This above general rule differs depending on whether a 32 bit or 64 bit
platform is used, which is described in the table below 

 Platform: 32 bit , Range: -2^31-1 and 2^31-1,Numbers: -2147483647 to
2147483647
Platform: 64 bit , Range: -2^63-1 and 2^63-1,Numbers: -9223372036854775807
to 23372036854775807

<?php
$large_number=9223372036854775807;
var_dump($large_number);
// output: int(9223372036854775807)
$large_number = 9223372036854775808;
var_dump($large_number);
// output: float(9.2233720368548E+18) as 9223372036854775808

//2^64-1 is 18446744073709551615
var_dump(0xffffffffffffffff);
// output: float(1.844674407371E+19) as 18446744073709551615
?>

Actual result:
--------------
No documentation regarding 64 bit platform in online php manual also.i
added these info as add a note even it is not approved. i am interested in
contributing php manual.please do the needful.

-- 
Edit bug report at http://bugs.php.net/?id=47718&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        http://bugs.php.net/fix.php?id=47718&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        http://bugs.php.net/fix.php?id=47718&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        http://bugs.php.net/fix.php?id=47718&r=trysnapshot60
Fixed in CVS:                        http://bugs.php.net/fix.php?id=47718&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47718&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=47718&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=47718&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=47718&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=47718&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=47718&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=47718&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=47718&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=47718&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=47718&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47718&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47718&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=47718&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=47718&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=47718&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=47718&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=47718&r=mysqlcfg



Thread (5 messages)

« previous php.doc.bugs (#2006) next »