public static function rangeFromBoundaries($from, $to)
    {
        $result = null;
        $invalid = false;
        foreach (array('from', 'to') as $param) {
            if (!($$param instanceof AddressInterface)) {
                $$param = (string) $$param;
                if ($$param === '') {
                    $$param = null;
                } else {
                    $$param = static::addressFromString($$param);
                    if ($$param === null) {
                        $invalid = true;
                    }
                }
            }
        }
        if ($invalid === false) {
            $result = static::rangeFromBoundaryAddresses($from, $to);
        }

        return $result;
    }
public static function rangeFromBoundaries($from, $to)
    {
        $result = null;
        $invalid = false;
        foreach (array('from', 'to') as $param) {
            if (!($$param instanceof AddressInterface)) {
                $$param = (string) $$param;
                if ($$param === '') {
                    $$param = null;
                } else {
                    $$param = static::addressFromString($$param);
                    if ($$param === null) {
                        $invalid = true;
                    }
                }
            }
        }
        if ($invalid === false) {
            $result = static::rangeFromBoundaryAddresses($from, $to);
        }

        return $result;
    }
public static function rangeFromBoundaries ( $ from , $ to ) { $ result = null ; $ invalid = false ; foreach ( array ( 'from' , 'to' ) as $ param ) { if ( ! ( $ $ param instanceof AddressInterface ) ) { $ $ param = ( string ) $ $ param ; if ( $ $ param === '' ) { $ $ param = null ; } else { $ $ param = static :: addressFromString ( $ $ param ) ; if ( $ $ param === null ) { $ invalid = true ; } } } } if ( $ invalid === false ) { $ result = static :: rangeFromBoundaryAddresses ( $ from , $ to ) ; } return $ result ; }
Create a Range instance starting from its boundaries.

@param string|\IPLib\Address\AddressInterface $from
@param string|\IPLib\Address\AddressInterface $to

@return \IPLib\Range\RangeInterface|null
Create a Range instance starting from its boundaries .