public function getIpAddress()
    {
        $pattern = new UriPattern();
        $pattern->matchHost($this->getHost(), $match);

        if (isset($match['IPv4address'])) {
            return $match['IPv4address'];
        } elseif (isset($match['IP_literal'])) {
            return preg_replace('/^\\[(v[^.]+\\.)?([^\\]]+)\\]$/', '$2', $match['IP_literal']);
        }

        return null;
    }
public function getIpAddress()
    {
        $pattern = new UriPattern();
        $pattern->matchHost($this->getHost(), $match);

        if (isset($match['IPv4address'])) {
            return $match['IPv4address'];
        } elseif (isset($match['IP_literal'])) {
            return preg_replace('/^\\[(v[^.]+\\.)?([^\\]]+)\\]$/', '$2', $match['IP_literal']);
        }

        return null;
    }
public function getIpAddress ( ) { $ pattern = new UriPattern ( ) ; $ pattern -> matchHost ( $ this -> getHost ( ) , $ match ) ; if ( isset ( $ match [ 'IPv4address' ] ) ) { return $ match [ 'IPv4address' ] ; } elseif ( isset ( $ match [ 'IP_literal' ] ) ) { return preg_replace ( '/^\\[(v[^.]+\\.)?([^\\]]+)\\]$/' , '$2' , $ match [ 'IP_literal' ] ) ; } return null ; }
Returns the IP address from the host component.
@return string|null IP address from the host or null if the host is not an IP address
Returns the IP address from the host component .