private function decodeHost($hostname)
    {
        if (preg_match('/^[\\x00-\\x7F]*$/', $hostname)) {
            return $hostname;
        } elseif ($this->mode !== self::MODE_IDNA2003) {
            throw new \InvalidArgumentException("Invalid hostname '$hostname'");
        }

        $hostname = idn_to_ascii($hostname);

        if ($hostname === false) {
            throw new \InvalidArgumentException("Invalid hostname '$hostname'");
        }

        return $hostname;
    }
private function decodeHost($hostname)
    {
        if (preg_match('/^[\\x00-\\x7F]*$/', $hostname)) {
            return $hostname;
        } elseif ($this->mode !== self::MODE_IDNA2003) {
            throw new \InvalidArgumentException("Invalid hostname '$hostname'");
        }

        $hostname = idn_to_ascii($hostname);

        if ($hostname === false) {
            throw new \InvalidArgumentException("Invalid hostname '$hostname'");
        }

        return $hostname;
    }
private function decodeHost ( $ hostname ) { if ( preg_match ( '/^[\\x00-\\x7F]*$/' , $ hostname ) ) { return $ hostname ; } elseif ( $ this -> mode !== self :: MODE_IDNA2003 ) { throw new \ InvalidArgumentException ( "Invalid hostname '$hostname'" ) ; } $ hostname = idn_to_ascii ( $ hostname ) ; if ( $ hostname === false ) { throw new \ InvalidArgumentException ( "Invalid hostname '$hostname'" ) ; } return $ hostname ; }
Decodes the hostname component according to parser mode.
@param string $hostname The parsed hostname
@return string The decoded hostname
@throws \InvalidArgumentException If the hostname is not valid
Decodes the hostname component according to parser mode .