May I know how can I do PHP >>> ? Such operators is not available in PHP, but is available in Javascript.
I just managed to discover a function as follow:
For both 32-bit (PHP_INT_SIZE == 4) and 64-bit integers (PHP_INT_SIZE == 8):
function SHR ($x, $c) { $x = intval ($x); // Because 13.5 >> 0 returns 13. We follow. $nmaxBits = PHP_INT_SIZE * 8; $c %= $nmaxBits; if ($c) return $x >> $c & ~ (-1 << $nmaxBits - $c); else return $x; }