src/Validator/Specific/EmailAddress.php
private function isReserved(string $host): bool
    {
        $hosts = [$host];
        if (!\preg_match('/^([0-9]{1,3}\.){3}[0-9]{1,3}$/', $host)) {
            $tmp = \gethostbynamel($host);
            $hosts = $tmp !== false ? $tmp : [];
        }

        $res = true;
        $flags = FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE;
        foreach ($hosts as $host) {
            if (\filter_var($host, FILTER_VALIDATE_IP, ['flags' => $flags]) !== false) {
                $res = false;
                break;
            }
        }

        return $res;
    }
private function isReserved(string $host): bool
    {
        $hosts = [$host];
        if (!\preg_match('/^([0-9]{1,3}\.){3}[0-9]{1,3}$/', $host)) {
            $tmp = \gethostbynamel($host);
            $hosts = $tmp !== false ? $tmp : [];
        }

        $res = true;
        $flags = FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE;
        foreach ($hosts as $host) {
            if (\filter_var($host, FILTER_VALIDATE_IP, ['flags' => $flags]) !== false) {
                $res = false;
                break;
            }
        }

        return $res;
    }
private function isReserved ( string $ host ) : bool { $ hosts = [ $ host ] ; if ( ! \ preg_match ( '/^([0-9]{1,3}\.){3}[0-9]{1,3}$/' , $ host ) ) { $ tmp = \ gethostbynamel ( $ host ) ; $ hosts = $ tmp !== false ? $ tmp : [ ] ; } $ res = true ; $ flags = FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE ; foreach ( $ hosts as $ host ) { if ( \ filter_var ( $ host , FILTER_VALIDATE_IP , [ 'flags' => $ flags ] ) !== false ) { $ res = false ; break ; } } return $ res ; }
Checks whether host IP is private or reserved

@param string $host
@return bool
Checks whether host IP is private or reserved