private static function decode_dynamic_integer(&$input, &$off)
{
$c = \ord($input[$off++]);
$int = $c & 0x7f;
$i = 0;
while ($c & 0x80) {
if (!isset($input[$off])) {
return -0x80;
}
$c = \ord($input[$off++]);
$int += ($c & 0x7f) << ++$i * 7;
}
return $int;
}