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.3.29, 5.4.27 - 5.4.38, 5.5.24 - 5.5.32, 5.5.34 - 5.6.17, 5.6.20 - 5.6.28, 7.0.0 - 7.0.3, 7.0.5 - 7.1.0
Notice: Undefined variable: whoisserver in /in/LEPSj on line 3 Socket Error 0 - php_network_getaddresses: getaddrinfo failed: Name or service not known
Output for 5.2.6 - 5.3.28, 5.4.0 - 5.4.26, 5.4.39 - 5.4.45, 5.5.33, 5.6.18 - 5.6.19, 7.0.4
Notice: Undefined variable: whoisserver in /in/LEPSj on line 3 Socket Error 0 - php_network_getaddresses: getaddrinfo failed: System error
Output for hhvm-3.12.0
Notice: Undefined variable: whoisserver in /in/LEPSj on line 3 Socket Error 0 - System error
Output for hhvm-3.10.0
Notice: Undefined variable: whoisserver in /in/LEPSj on line 3 Socket Error 0 - Name or service not known
Output for 5.0.4 - 5.2.0, 5.2.2 - 5.2.5
Notice: Undefined variable: whoisserver in /in/LEPSj on line 3 Socket Error 0 -
Output for 5.2.1
Notice: Undefined variable: whoisserver in /in/LEPSj on line 3 Socket Error 1935633761 -
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: whoisserver in /in/LEPSj on line 3 Socket Error 0 -
Output for 4.3.2 - 4.3.4, 4.3.10 - 4.4.9
Notice: Undefined variable: whoisserver in /in/LEPSj on line 3 Socket Error 111 - Connection refused
Output for 4.3.5 - 4.3.9
Notice: Undefined variable: whoisserver in /in/LEPSj on line 3 Socket Error 11 - Resource temporarily unavailable
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: whoisserver in /in/LEPSj on line 3
Process exited with code 139.