* [php] Fix right unsign shift * Add test for unsign right shift [php]
@@ -480,7 +480,7 @@ class Boot {
if (right == 0) {
return left;
} else if (left >= 0) {
- return (left >> right);
+ return ((left >> right) & ~(1 << ( 8*Const.PHP_INT_SIZE-1 ) >> (right-1)));
} else {
return (left >> right) & (0x7fffffff >> (right - 1));
}
@@ -0,0 +1,8 @@
+package unit.issues;
+
+class Issue7533 extends unit.Test {
+ function test() {
+ var bint:Int = 0xB425B745;
+ eq( (bint>>>20), 0xB42);
+ }
+}