public static function parseHost($input, $isSpecial)
    {
        $inputString = (string)$input;
        if ($inputString !== '' && $inputString[0] === '[') {
            $result = substr($inputString, -1) !== ']' ? false : self::parseIPv6(substr($inputString, 1, -1));
        } elseif (!$isSpecial) {
            $result = static::parseOpaqueHost($input);
        } else {
            $domain = Infrastructure::percentDecode($input);
            $asciiDomain = self::domainToASCII($domain);
            $result = $asciiDomain === false || preg_match(static::FORBIDDEN_HOST_CODE_POINTS, $asciiDomain) !== 0
                ? false
                : self::parseIPv4($asciiDomain);
        }
        return $result;
    }