src/Xdr/XdrEncoder.php
public static function opaqueVariable($value)
    {
        $maxLength = pow(2, 32) - 1;
        if (strlen($value) > $maxLength) throw new \InvalidArgumentException(sprintf('Value of length %s is greater than the maximum allowed length of %s', strlen($value), $maxLength));

        $bytes = '';
        
        $bytes .= self::unsignedInteger(strlen($value));
        $bytes .= self::applyPadding($value);

        return $bytes;
    }
public static function opaqueVariable($value)
    {
        $maxLength = pow(2, 32) - 1;
        if (strlen($value) > $maxLength) throw new \InvalidArgumentException(sprintf('Value of length %s is greater than the maximum allowed length of %s', strlen($value), $maxLength));

        $bytes = '';
        
        $bytes .= self::unsignedInteger(strlen($value));
        $bytes .= self::applyPadding($value);

        return $bytes;
    }
Variable-length opaque data

Maximum length is 2^32 - 1

@param $value
@return string