Edit report at http://bugs.php.net/bug.php?id=50083&edit=1

 ID:                 50083
 Updated by:         [email protected]
 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

Reply via email to