private static function myValidateOctets(array $octets, ?string &$error): bool
    {
        if (count($octets) !== 4) {
            $error = 'IP address must consist of four octets.';

            return false;
        }

        foreach ($octets as $octet) {
            if (!is_int($octet)) {
                throw new \InvalidArgumentException('$octets is not an array of integers.');
            }

            if (!self::myValidateOctet($octet, $error)) {
                return false;
            }
        }

        return true;
    }