3v4l.org

run code in 300+ PHP versions simultaneously
<?php $host = "198.24.166.216"; $port = 25565; $socket = @fsockopen($host, $port); if ($socket !== false) { @fwrite($socket, "\xFE"); $data = ""; $data = @fread($socket, 1024); @fclose($socket); if ($data !== false && substr($data, 0, 1) == "\xFF") { $info = explode("\xA7", mb_convert_encoding(substr($data,1), "iso-8859-1", "utf-16be")); $serverName = substr($info[0], 1); $playersOnline = $info[1]; $playersMax = $info[2]; echo "Server: $serverName<br/>Players Online: $playersOnline/$playersMax"; } else { // Server did not send back proper data, or reading from socket failed. echo "Failed to receive data"; } } else { // Can't connect. Server is probably down. echo "Failed to connect"; } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Failed to connect

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.83 ms | 401 KiB | 8 Q