src/IP.php
public static function fromBinaryIP($ip)
    {
        if ($ip === null || $ip === '') {
            return new IPv4("\x00\x00\x00\x00");
        }

        if (self::isIPv4($ip)) {
            return new IPv4($ip);
        }

        return new IPv6($ip);
    }
public static function fromBinaryIP($ip)
    {
        if ($ip === null || $ip === '') {
            return new IPv4("\x00\x00\x00\x00");
        }

        if (self::isIPv4($ip)) {
            return new IPv4($ip);
        }

        return new IPv6($ip);
    }
public static function fromBinaryIP ( $ ip ) { if ( $ ip === null || $ ip === '' ) { return new IPv4 ( "\x00\x00\x00\x00" ) ; } if ( self :: isIPv4 ( $ ip ) ) { return new IPv4 ( $ ip ) ; } return new IPv6 ( $ ip ) ; }
Factory method to create an IP instance from an IP in binary format.

@see fromStringIP

@param string $ip IP address in a binary format.
@return IP
Factory method to create an IP instance from an IP in binary format .