3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $fp = fsockopen("8.8.8.8", 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { $out = "GET / HTTP/1.1\r\n"; $out .= "Host: www.example.com\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { echo fgets($fp, 128); } fclose($fp); }
Output for 5.0.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: fsockopen(): unable to connect to 8.8.8.8:80 (Network is unreachable) in /in/1ECgC on line 2 Network is unreachable (101)<br />
Output for hhvm-3.10.0 - 3.12.0
Warning: unable to connect to 8.8.8.8 [101]: Network is unreachable in /in/1ECgC on line 2 Network is unreachable (101)<br />
Output for 4.3.3 - 4.4.9
Warning: fsockopen(): unable to connect to 8.8.8.8:80 in /in/1ECgC on line 2 Network is unreachable (101)<br />
Output for 4.3.2
Warning: fsockopen(): php_hostconnect: connect failed in /in/1ECgC on line 2 Warning: fsockopen(): unable to connect to 8.8.8.8:80 in /in/1ECgC on line 2 Network is unreachable (101)<br />
Output for 4.3.0 - 4.3.1

Process exited with code 139.