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.4.0 - 5.4.26
Parse error: syntax error, unexpected '$port' (T_VARIABLE) in /in/sF15V on line 5
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE in /in/sF15V on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_VARIABLE in /in/sF15V on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/sF15V on line 5
Process exited with code 255.