3v4l.org

run code in 300+ PHP versions simultaneously
<?php header('Content-type: text/html; charset=utf-8'); // эта функция отправляет команду в сокет, и возвращает ответ от сервера function sWrite( $socket, $data, $echo = true ){ // отображаем отправляемую команду, если это требуется //if( $echo ) echo $data; // отправляем команду в сокет fputs( $socket, $data ); // получаем первый байт ответа от сервера $answer = fread( $socket, 1 ); // узнаем информацию о состоянии потока $remains = socket_get_status( $socket ); // и получаем оставшиеся байты ответа от сервера if( $remains --> 0 ) $answer .= fread( $socket, $remains['unread_bytes'] ); // функция возвращает ответ от сервера на переданную команду return $answer; } // адрес электропочты, который надо проверить $email = "admin@fcdk.kiev.ua"; // получаем данные об MX-записи домена, указанного в email $mx = dns_get_record( end( explode( "@", $email ) ), DNS_MX ); $mx = $mx[0]['target']; // открываем сокет и создаем поток $socket = fsockopen( $mx, 25, $errno, $errstr, 10 ); if( !$socket ){ //echo "$errstr ($errno)\n"; }else{ // отправляем пустую строку, чтобы получить приветствие сервера /*echo*/ sWrite( $socket, "" ); // представляемся сами /*echo*/ sWrite( $socket, "EHLO example.com\r\n" ); /*echo*/ sWrite( $socket, "MAIL FROM: dummy@example.com\r\n" ); // запрашиваем разрешение на отправку письма адресату $response = sWrite( $socket, "RCPT TO: $email\r\n" ); //echo $response; // закрываем соединение /*echo*/ sWrite( $socket, "QUIT\r\n" ); fclose( $socket ); // ниже идет простейшая обработка полученного ответа //echo "\nCheck report:\n"; if( substr_count( $response, "550" ) > 0 ) echo "Ящикa ".$email." нет.<br>"; else if( substr_count( $response, "250" ) > 0 ) if( substr_count( $response, "OK" ) > 0 ) echo "Ящик ".$email." есть.<br>"; else echo "Ящик ".$email." есть, но он какой-то странный (like a relay host).<br>"; else echo "Ящик ".$email." не был распознан <br>"; } //variant 2 if( $curl = curl_init() ) { curl_setopt($curl, CURLOPT_URL, 'http://stealthdebuger.com/post/'); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, "email=".$email); $out = curl_exec($curl); //echo $out; curl_close($curl); } $out = iconv("Windows-1251", "UTF-8", $out); $out_arr = explode('<h5>Проверка существования email</h5><hr>', $out); $res2 = $out_arr[1]; $out_arr = explode('</h5><hr>', $res2); $res2 = $out_arr[0]; $answer = trim(strip_tags($res2)); echo $answer;
Output for 8.3.0 - 8.3.6
Notice: Only variables should be passed by reference in /in/7H3ck on line 24 Warning: dns_get_record(): A temporary server error occurred. in /in/7H3ck on line 24 Warning: Trying to access array offset on false in /in/7H3ck on line 25 Warning: Trying to access array offset on null in /in/7H3ck on line 25 Deprecated: fsockopen(): Passing null to parameter #1 ($hostname) of type string is deprecated in /in/7H3ck on line 27 Warning: fsockopen(): php_network_getaddresses: getaddrinfo for failed: System error in /in/7H3ck on line 27 Warning: fsockopen(): Unable to connect to :25 (php_network_getaddresses: getaddrinfo for failed: System error) in /in/7H3ck on line 27 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/7H3ck:52 Stack trace: #0 {main} thrown in /in/7H3ck on line 52
Process exited with code 255.
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Notice: Only variables should be passed by reference in /in/7H3ck on line 24 Warning: dns_get_record(): A temporary server error occurred. in /in/7H3ck on line 24 Warning: Trying to access array offset on value of type bool in /in/7H3ck on line 25 Warning: Trying to access array offset on value of type null in /in/7H3ck on line 25 Deprecated: fsockopen(): Passing null to parameter #1 ($hostname) of type string is deprecated in /in/7H3ck on line 27 Warning: fsockopen(): php_network_getaddresses: getaddrinfo for failed: System error in /in/7H3ck on line 27 Warning: fsockopen(): Unable to connect to :25 (php_network_getaddresses: getaddrinfo for failed: System error) in /in/7H3ck on line 27 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/7H3ck:52 Stack trace: #0 {main} thrown in /in/7H3ck on line 52
Process exited with code 255.
Output for 8.0.13 - 8.0.30
Notice: Only variables should be passed by reference in /in/7H3ck on line 24 Warning: dns_get_record(): A temporary server error occurred. in /in/7H3ck on line 24 Warning: Trying to access array offset on value of type bool in /in/7H3ck on line 25 Warning: Trying to access array offset on value of type null in /in/7H3ck on line 25 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: System error in /in/7H3ck on line 27 Warning: fsockopen(): Unable to connect to :25 (php_network_getaddresses: getaddrinfo failed: System error) in /in/7H3ck on line 27 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/7H3ck:52 Stack trace: #0 {main} thrown in /in/7H3ck on line 52
Process exited with code 255.
Output for 8.0.0 - 8.0.12
Notice: Only variables should be passed by reference in /in/7H3ck on line 24 Warning: dns_get_record(): A temporary server error occurred. in /in/7H3ck on line 24 Warning: Trying to access array offset on value of type bool in /in/7H3ck on line 25 Warning: Trying to access array offset on value of type null in /in/7H3ck on line 25 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/7H3ck on line 27 Warning: fsockopen(): Unable to connect to :25 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /in/7H3ck on line 27 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/7H3ck:52 Stack trace: #0 {main} thrown in /in/7H3ck on line 52
Process exited with code 255.
Output for 7.4.26 - 7.4.33
Notice: Only variables should be passed by reference in /in/7H3ck on line 24 Warning: dns_get_record(): A temporary server error occurred. in /in/7H3ck on line 24 Notice: Trying to access array offset on value of type bool in /in/7H3ck on line 25 Notice: Trying to access array offset on value of type null in /in/7H3ck on line 25 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: System error in /in/7H3ck on line 27 Warning: fsockopen(): unable to connect to :25 (php_network_getaddresses: getaddrinfo failed: System error) in /in/7H3ck on line 27 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/7H3ck:52 Stack trace: #0 {main} thrown in /in/7H3ck on line 52
Process exited with code 255.
Output for 7.4.0 - 7.4.25
Notice: Only variables should be passed by reference in /in/7H3ck on line 24 Warning: dns_get_record(): A temporary server error occurred. in /in/7H3ck on line 24 Notice: Trying to access array offset on value of type bool in /in/7H3ck on line 25 Notice: Trying to access array offset on value of type null in /in/7H3ck on line 25 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/7H3ck on line 27 Warning: fsockopen(): unable to connect to :25 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /in/7H3ck on line 27 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/7H3ck:52 Stack trace: #0 {main} thrown in /in/7H3ck on line 52
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Warning: dns_get_record(): A temporary server error occurred. in /in/7H3ck on line 24 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: System error in /in/7H3ck on line 27 Warning: fsockopen(): unable to connect to :25 (php_network_getaddresses: getaddrinfo failed: System error) in /in/7H3ck on line 27 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/7H3ck:52 Stack trace: #0 {main} thrown in /in/7H3ck on line 52
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31
Notice: Only variables should be passed by reference in /in/7H3ck on line 24 Warning: dns_get_record(): A temporary server error occurred. in /in/7H3ck on line 24 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/7H3ck on line 27 Warning: fsockopen(): unable to connect to :25 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /in/7H3ck on line 27 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/7H3ck:52 Stack trace: #0 {main} thrown in /in/7H3ck on line 52
Process exited with code 255.
Output for 5.5.21 - 5.5.38, 5.6.5 - 5.6.40
Strict Standards: Only variables should be passed by reference in /in/7H3ck on line 24 Warning: dns_get_record(): A temporary server error occurred. in /in/7H3ck on line 24 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/7H3ck on line 27 Warning: fsockopen(): unable to connect to :25 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /in/7H3ck on line 27 Fatal error: Call to undefined function curl_init() in /in/7H3ck on line 52
Process exited with code 255.
Output for 5.3.2 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.20, 5.6.0 - 5.6.4
Strict Standards: Only variables should be passed by reference in /in/7H3ck on line 24 Notice: Undefined offset: 0 in /in/7H3ck on line 25 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/7H3ck on line 27 Warning: fsockopen(): unable to connect to :25 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /in/7H3ck on line 27 Fatal error: Call to undefined function curl_init() in /in/7H3ck on line 52
Process exited with code 255.
Output for 5.3.1
Strict Standards: Only variables should be passed by reference in /in/7H3ck on line 24 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/7H3ck on line 27 Warning: fsockopen(): unable to connect to :25 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /in/7H3ck on line 27 Fatal error: Call to undefined function curl_init() in /in/7H3ck on line 52
Process exited with code 255.
Output for 5.2.6 - 5.2.17, 5.3.0
Strict Standards: Only variables should be passed by reference in /in/7H3ck on line 24 Warning: dns_get_record(): res_nsend() failed in /in/7H3ck on line 24 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/7H3ck on line 27 Warning: fsockopen(): unable to connect to :25 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /in/7H3ck on line 27 Fatal error: Call to undefined function curl_init() in /in/7H3ck on line 52
Process exited with code 255.
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.5
Strict Standards: Only variables should be passed by reference in /in/7H3ck on line 24 Warning: dns_get_record(): res_nsend() failed in /in/7H3ck on line 24 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/7H3ck on line 27 Warning: fsockopen(): unable to connect to :25 (Unknown error) in /in/7H3ck on line 27 Fatal error: Call to undefined function curl_init() in /in/7H3ck on line 52
Process exited with code 255.
Output for 5.0.5
Fatal error: Only variables can be passed by reference in /in/7H3ck on line 24
Process exited with code 255.
Output for 5.0.3 - 5.0.4
Warning: dns_get_record(): res_nsend() failed in /in/7H3ck on line 24 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/7H3ck on line 27 Warning: fsockopen(): unable to connect to :25 (Unknown error) in /in/7H3ck on line 27 Fatal error: Call to undefined function curl_init() in /in/7H3ck on line 52
Process exited with code 255.
Output for 5.0.0 - 5.0.2
Warning: dns_get_record(): res_nsend() failed in /in/7H3ck on line 24 Warning: fsockopen(): php_network_getaddresses: gethostbyname failed in /in/7H3ck on line 27 Warning: fsockopen(): unable to connect to :25 (Unknown error) in /in/7H3ck on line 27 Fatal error: Call to undefined function curl_init() in /in/7H3ck on line 52
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: dns_get_record() in /in/7H3ck on line 24
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: dns_get_record() in /in/7H3ck on line 24
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: dns_get_record() in /in/7H3ck on line 24

preferences:
330.98 ms | 401 KiB | 465 Q