3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $fp = fsockopen("127.0.0.1", 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 - 7.2.6
Warning: fsockopen(): unable to connect to 127.0.0.1:80 (Connection refused) in /in/p9bPE on line 3 Connection refused (111)<br />
Output for 4.3.3 - 4.4.9
Warning: fsockopen(): unable to connect to 127.0.0.1:80 in /in/p9bPE on line 3 Connection refused (111)<br />
Output for 4.3.2
Warning: fsockopen(): php_hostconnect: connect failed in /in/p9bPE on line 3 Warning: fsockopen(): unable to connect to 127.0.0.1:80 in /in/p9bPE on line 3 Connection refused (111)<br />
Output for 4.3.0 - 4.3.1

Process exited with code 139.