src/Validator/Specific/EmailAddress.php
private function mxCheck(string $value = ''): bool
    {
        $mxHosts = [];
        $weight = [];

        if (@\getmxrr($value, $mxHosts, $weight) !== false) {
            if (!empty($mxHosts) && !empty($weight)) {
                $mxHosts = \array_combine($mxHosts, $weight);
            }
            \arsort($mxHosts);
        } elseif (($result = @\gethostbynamel($value)) !== false) {
            $mxHosts = \array_flip($result);
        }

        $isValid = true;
        if (empty($mxHosts)) {
            $isValid = false;
        } elseif ($this->options['deep-mx-check'] === true) {
            $isValid = $this->deepMxCheck($mxHosts);
        }
        if (!$isValid) {
            $this->setError(self::VALIDATOR_ERROR_EMAIL_INVALID_MX);
        }

        return $isValid;
    }
private function mxCheck(string $value = ''): bool
    {
        $mxHosts = [];
        $weight = [];

        if (@\getmxrr($value, $mxHosts, $weight) !== false) {
            if (!empty($mxHosts) && !empty($weight)) {
                $mxHosts = \array_combine($mxHosts, $weight);
            }
            \arsort($mxHosts);
        } elseif (($result = @\gethostbynamel($value)) !== false) {
            $mxHosts = \array_flip($result);
        }

        $isValid = true;
        if (empty($mxHosts)) {
            $isValid = false;
        } elseif ($this->options['deep-mx-check'] === true) {
            $isValid = $this->deepMxCheck($mxHosts);
        }
        if (!$isValid) {
            $this->setError(self::VALIDATOR_ERROR_EMAIL_INVALID_MX);
        }

        return $isValid;
    }
private function mxCheck ( string $ value = '' ) : bool { $ mxHosts = [ ] ; $ weight = [ ] ; if ( @ \ getmxrr ( $ value , $ mxHosts , $ weight ) !== false ) { if ( ! empty ( $ mxHosts ) && ! empty ( $ weight ) ) { $ mxHosts = \ array_combine ( $ mxHosts , $ weight ) ; } \ arsort ( $ mxHosts ) ; } elseif ( ( $ result = @ \ gethostbynamel ( $ value ) ) !== false ) { $ mxHosts = \ array_flip ( $ result ) ; } $ isValid = true ; if ( empty ( $ mxHosts ) ) { $ isValid = false ; } elseif ( $ this -> options [ 'deep-mx-check' ] === true ) { $ isValid = $ this -> deepMxCheck ( $ mxHosts ) ; } if ( ! $ isValid ) { $ this -> setError ( self :: VALIDATOR_ERROR_EMAIL_INVALID_MX ) ; } return $ isValid ; }
Performs MX check

@param string $value
@return bool
Performs MX check