3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fwrite_with_retry($sock, &$data) { $bytes_to_write = strlen($data); $bytes_written = 0; while ( $bytes_written < $bytes_to_write ) { if ( $bytes_written == 0 ) { $rv = fwrite($sock, $data); } else { $rv = fwrite($sock, substr($data, $bytes_written)); } if ( $rv === false || $rv == 0 ) return( $bytes_written == 0 ? false : $bytes_written ); $bytes_written += $rv; } return $bytes_written; } $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: 3v4l.org\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite_with_retry($fp, $out); while (!feof($fp)) { echo fgets($fp, 128); } fclose($fp); }
Output for git.master, git.master_jit, rfc.property-hooks
Warning: fsockopen(): Unable to connect to 127.0.0.1:80 (Unknown error) in /in/HDgpN on line 24 (0)<br />

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
38.26 ms | 401 KiB | 8 Q