3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $whoisserver = "whois.verisign-grs.co"; $domain = "=stackoverflow.com"; $port = 43; $timeout = 10; $fp = @fsockopen($whoisserver, $port, $errno, $errstr, $timeout) or die("Socket Error " . $errno . " - " . $errstr); fputs($fp, $domain . "\r\n"); $out = ""; while(!feof($fp)){ $out .= fgets($fp); } fclose($fp); $res = ""; if((strpos(strtolower($out), "error") === FALSE) && (strpos(strtolower($out), "not allocated") === FALSE)) { $rows = explode("\n", $out); foreach($rows as $row) { $row = trim($row); if(($row != '') && ($row{0} != '#') && ($row{0} != '%')) { $res .= $row."\n"; } } } print $res;
Output for 5.2.6 - 5.6.28, 7.0.0 - 7.1.0
Socket Error 0 - php_network_getaddresses: getaddrinfo failed: Name or service not known
Output for hhvm-3.10.0 - 3.12.0
Socket Error 0 - Name or service not known
Output for 5.0.0 - 5.2.0, 5.2.2 - 5.2.5
Socket Error 0 -
Output for 5.2.1
Socket Error 1935633761 -
Output for 4.3.2 - 4.3.4, 4.3.10 - 4.4.9
Socket Error 111 - Connection refused
Output for 4.3.5 - 4.3.9
Socket Error 0 - Success
Output for 4.3.0 - 4.3.1

Process exited with code 139.