Req #33933 [Com]: 64bit signed integer support
| From: | ajf@php.net | Date: | Thu, 08 Jan 2015 23:43:24 +0000 |
| Subject: | Req #33933 [Com]: 64bit signed integer support | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-189787@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=33933&edit=1
ID: 33933
Comment by: ajf@php.net
Reported by: detonator316 at gmail dot com
Summary: 64bit signed integer support
Status: Open
Type: Feature/Change Request
Package: Feature/Change Request
Operating System: Any 32bit platform
PHP Version: 5.1.0b3
Block user comment: N
Private report: N
New Comment:
The bigints RFC would resolve this on 32-bit platforms: http://wiki.php.net/rfc/bigint
Previous Comments:
------------------------------------------------------------------------
[2005-07-31 01:33:14] detonator316 at gmail dot com
Description:
------------
Better support for 64bit integers would be very nice, for example when performing this operation:
$val = 0x1 << 32;
echo $val;
The value "1" is returned, due to the 32bit wrapping applied to the integer. Even when
using type casts to float or double it doesn't extend beyond 32bits.
An extra type such as Int64 would be very useful.
Reproduce code:
---------------
$val = 0x1 << 32;
echo $val."\n";
(float)$val = (float)0x1 << 32;
echo $val;
Expected result:
----------------
It should output "4294967296" for both
Actual result:
--------------
It outputs "1" due to 32bit wrapping
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=33933&edit=1