#47718 [Opn->Asn]: Integers overflow for 64 bit platform
ID: 47718
Updated by: kalle@php.net
Reported By: vivekanandan8 at yahoo dot com
-Status: Open
+Status: Assigned
Bug Type: Documentation problem
Operating System: all os
PHP Version: Irrelevant
-Assigned To:
+Assigned To: mattwil
New Comment:
Matt, you have worked on some 64bit overflows recently, think you
could look into this?
Previous Comments:
------------------------------------------------------------------------
[2009-03-19 14:46:45] vivekanandan8 at yahoo dot com
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 this bug report at http://bugs.php.net/?id=47718&edit=1
Thread (5 messages)