src/Url.php
public function getHostAndPort(): string
    {
        if ($this->myPort !== $this->myScheme->getDefaultPort()) {
            return $this->myHost . ':' . $this->myPort;
        }

        return $this->myHost->__toString();
    }
public function getHostAndPort(): string
    {
        if ($this->myPort !== $this->myScheme->getDefaultPort()) {
            return $this->myHost . ':' . $this->myPort;
        }

        return $this->myHost->__toString();
    }
public function getHostAndPort ( ) : string { if ( $ this -> myPort !== $ this -> myScheme -> getDefaultPort ( ) ) { return $ this -> myHost . ':' . $ this -> myPort ; } return $ this -> myHost -> __toString ( ) ; }
Returns the host and port of the url as a string.

@since 1.0.0

@return string The host and port of the url.
Returns the host and port of the url as a string .