private static function _decodeLongFormLength(int $length, string $data,
        int &$offset): string
    {
        // first octet must not be 0xff (spec 8.1.3.5c)
        if ($length == 127) {
            throw new DecodeException("Invalid number of length octets.");
        }
        $num = gmp_init(0, 10);
        while (--$length >= 0) {
            $byte = ord($data[$offset++]);
            $num <<= 8;
            $num |= $byte;
        }
        return gmp_strval($num);
    }
private static function _decodeLongFormLength(int $length, string $data,
        int &$offset): string
    {
        // first octet must not be 0xff (spec 8.1.3.5c)
        if ($length == 127) {
            throw new DecodeException("Invalid number of length octets.");
        }
        $num = gmp_init(0, 10);
        while (--$length >= 0) {
            $byte = ord($data[$offset++]);
            $num <<= 8;
            $num |= $byte;
        }
        return gmp_strval($num);
    }
private static function _decodeLongFormLength ( int $ length , string $ data , int & $ offset ) : string { // first octet must not be 0xff (spec 8.1.3.5c) if ( $ length == 127 ) { throw new DecodeException ( "Invalid number of length octets." ) ; } $ num = gmp_init ( 0 , 10 ) ; while ( -- $ length >= 0 ) { $ byte = ord ( $ data [ $ offset ++ ] ) ; $ num <<= 8 ; $ num |= $ byte ; } return gmp_strval ( $ num ) ; }
Decode long form length.

@param int $length Number of octets
@param string $data Data
@param int $offset Reference to the variable containing offset to the
data.
@throws DecodeException If decoding fails
@return string Integer as a string
Decode long form length .