3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function checkEmail($email) { $email = trim($email); if (filter_var($email, FILTER_VALIDATE_EMAIL) === false) { var_dump(__LINE__); return false; } list($username, $domain) = explode("@", $email); if (getmxrr($domain, $mxHost)) { var_dump(__LINE__); return true; } else { var_dump(gethostbyname($domain), gethostbyaddr(gethostbyname($domain))); if (stripos(gethostbyaddr(gethostbyname($domain)), $domain) !== false) { var_dump(__LINE__); return true; } var_dump($domain, checkdnsrr($domain, 'MX')); if (checkdnsrr($domain, 'MX')) { var_dump(__LINE__); return true; } // Is domain valid if (filter_var(gethostbyname($domain), FILTER_VALIDATE_IP)) { if (fsockopen($domain, 25, $errno, $errstr, 5)) { var_dump(__LINE__); return true; } } } var_dump(__LINE__); return false; } var_dump(checkEmail('kaidof@yahoo.com')); getmxrr('yahoo.com', $out); print_r($out); $a = checkdnsrr('yahoo.com', 'ANY'); var_dump($a); var_dump(getmxrr("yahoo.com", $var)); var_dump($var); var_dump(checkdnsrr("yahoo.com"));
based on j3fMp
Output for 7.1.0
Warning: gethostbyaddr(): Address is not a valid IPv4 or IPv6 address in /in/4v774 on line 17 string(9) "yahoo.com" bool(false) Warning: gethostbyaddr(): Address is not a valid IPv4 or IPv6 address in /in/4v774 on line 18 string(9) "yahoo.com" bool(false) int(39) bool(false) Array ( ) bool(false) bool(false) array(0) { } bool(false)