public static function numberOfTrailingZeros(int $i) : int
    {
        $lastPos = strrpos(str_pad(decbin($i), 32, '0', STR_PAD_LEFT), '1');
        return $lastPos === false ? 32 : 31 - $lastPos;
    }