public static function getByAddress($address, $hostname = null)
    {
        $addrLen = strlen($address);
        if ($addrLen === 4) {
            return new Inet4Address($address, $hostname);
        } elseif ($addrLen == 16) {
            return new Inet6Address($address, $hostname);
        }

        throw new UnknownHostException($address);
    }
public static function getByAddress($address, $hostname = null)
    {
        $addrLen = strlen($address);
        if ($addrLen === 4) {
            return new Inet4Address($address, $hostname);
        } elseif ($addrLen == 16) {
            return new Inet6Address($address, $hostname);
        }

        throw new UnknownHostException($address);
    }
public static function getByAddress ( $ address , $ hostname = null ) { $ addrLen = strlen ( $ address ) ; if ( $ addrLen === 4 ) { return new Inet4Address ( $ address , $ hostname ) ; } elseif ( $ addrLen == 16 ) { return new Inet6Address ( $ address , $ hostname ) ; } throw new UnknownHostException ( $ address ) ; }
Returns an InetAddress object given the raw IP address .

@param string      $address  the raw IP address as binary string
@param null|string $hostname the hostname

@return InetAddress an InetAddress object created from the raw IP address
@throws UnknownHostException if IP address is of illegal length
Returns an InetAddress object given the raw IP address .