Req #50083 [Opn->Wfx]: Bit shift
| From: | jani@php.net | Date: | Mon, 20 Dec 2010 08:29:23 +0000 |
| Subject: | Req #50083 [Opn->Wfx]: Bit shift | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-157112@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=50083&edit=1
ID: 50083
Updated by: jani@php.net
Reported by: talk at apfeldot dot de
Summary: Bit shift
-Status: Open
+Status: Wont fix
Type: Feature/Change Request
-Package: Feature/Change Request
+Package: *General Issues
Operating System: Win 7
PHP Version: 5.3.0
Block user comment: N
Private report: N
New Comment:
http://www.php.net/manual/en/language.operators.bitwise.php
There's big warning with note:
"Use functions from the gmp extension for bitwise manipulation on
numbers beyond PHP_INT_MAX."
Previous Comments:
------------------------------------------------------------------------
[2009-11-04 23:27:47] talk at apfeldot dot de
Description:
------------
I think there is an integer overflow, which should be prevented.
Reproduce code:
---------------
<?php
var_dump(1 << 33);
?>
Expected result:
----------------
There should be int(0), because the 1 was shifted out of the integer
representation and the binary code should be 00000...00000.
Actual result:
--------------
int(2)
Binary represantation: 00...0010
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=50083&edit=1