public static function zigZagDecode32($uint32) { // Fill high 32 bits. if (PHP_INT_SIZE === 8) { $uint32 |= $uint32 & 0xffffffff; } $int32 = $uint32 >> 1 & 0x7fffffff ^ -($uint32 & 1); return $int32; }