3v4l.org

run code in 300+ PHP versions simultaneously
<center> <?php /* Live SHOUTcast statistics for multiple servers This script is (C) Bell Online Ltd 2012 If you use this script, please leave the copyright notice and link at the bottom of the page or link to mixstream.net somewhere on your website. Feel free to modify it in any other way to suit your needs. Version: v1.1 ## Updates: ## 1.1, Added fclose() */ /* ---------- General configuration ---------- */ $station_name = "Galaxy Radio"; $refresh = "30"; // Page refresh time in seconds. Put 0 for no refresh $timeout = "1"; // Number of seconds before connecton times out - a higher value will slow the page down if any servers are offline /* ----------- Server configuration ---------- */ // Note: dont include http:// // Main server: The song title will be taken from this server $ip[1] = "107.150.2.89"; $port[1] = "8000"; /* ----- No need to edit below this line ----- */ /* ------------------------------------------- */ $servers = count($ip); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <?php if ($refresh != "0") { print "<meta http-equiv=\"refresh\" content=\"$refresh\">\n"; } print "<title>$station_name SHOUTcast Stats</title>\n"; ?> <style type="text/css"> <!-- body { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #333333; margin: 5px; background-color: #fff; } div { background-color: #fef9f2; border: 1px solid #000; padding: 4px; margin-bottom: 5px; width: 450px; } div div { margin: 5px; border: 0; background-color: #fef9f2; margin: 5px; margin-bottom: 0; } h1 { font-size: 22px; color: #000; margin: 2px; } h2 { font-size: 14px; color: #336666; margin: 2px; } p { margin: 5px; } a { color: #666699; text-decoration: none; } a:hover { color: #993333; } div.line { border-bottom: 1px dashed #000; height: 3px; font-size: 1px; margin-top: 0; } div#blu, div#blu div { background-color: #b2bfc0; } .red { color: #CC0000; font-weight: bold; } .small { font-size: 10px; } --> </style> </head> <body> <?php $i = "1"; while($i<=$servers) { $fp = @fsockopen($ip[$i],$port[$i],$errno,$errstr,$timeout); if (!$fp) { $listeners[$i] = "0"; $msg[$i] = "<span class=\"red\">ERROR [Ο server είναι εκτός λειτουργίας]</span>"; $error[$i] = "1"; } else { fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n"); while (!feof($fp)) { $info = fgets($fp); } $info = str_replace('<HTML><meta http-equiv="Pragma" content="no-cache"></head><body>', "", $info); $info = str_replace('</body></html>', "", $info); $stats = explode(',', $info); if (empty($stats[1]) ) { $listeners[$i] = "0"; $msg[$i] = "<span class=\"red\">ERROR [Δεν εκπέμπει κάποιος DJ]</span>"; $error[$i] = "1"; } else { if ($stats[1] == "1") { $song[$i] = $stats[6]; $listeners[$i] = $stats[0]; $max[$i] = $stats[3]; $bitrate[$i] = $stats[5]; $peak[$i] = $stats[2]; if ($stats[0] == $max[$i]) { $msg[$i] .= "<span class=\"red\">"; } $msg[$i] .= "Online στα $bitrate[$i] kbps με $listeners[$i] συνδεδεμένους ακροατές"; if ($stats[0] == $max[$i]) { $msg[$i] .= "</span>"; } //$msg[$i] .= "\n <p><b>Listener peak:</b> $peak[$i]"; } else { $listeners[$i] = "0"; $msg[$i] = " <span class=\"red\">ERROR [Cannot get info from server]</span>"; $error[$i] = "1"; } } } //fclose($fp); $i++; } $total_listeners = array_sum($listeners) ; print "<div>\n <div>\n <p><b>Το τραγούδι που ακούμε:</b> $song[1]</p>\n </div>\n</div>\n<div>\n"; $i = "1"; while($i<=$servers) { print " <div>\n"; if ($max[$i] > 0) { $percentage = round(($listeners[$i] / $max[$i] * 100)); $timesby = (300 / $max[$i]); $barlength = round(($listeners[$i] * "$timesby")); } if ($error[$i] != "1") { ?> <?php } else { ?> <?php } print "<b>Radio:</b> $msg[$i]"; $i++; } $time_difference = "0"; // BST: 1 GMT: 0 $time_difference = ($time_difference * 60 * 60); $time = date("h:ia", time() + $time_difference); $date = date("jS F, Y", time() + 0); ?> <div> </div> </body> </html> </center>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.4.00.0000.01815.34
7.3.120.0100.00714.95
7.3.110.0090.00915.04
7.3.100.0040.00714.94
7.3.90.0000.01215.21
7.3.80.0120.00015.36
7.3.70.0030.00915.23
7.3.60.0070.01015.29
7.3.50.0130.00314.89
7.3.40.0070.00314.96
7.3.30.0000.01615.17
7.3.20.0060.00917.01
7.3.10.0060.01016.99
7.3.00.0000.01116.65
7.2.250.0030.01615.27
7.2.240.0130.00315.01
7.2.230.0030.01315.42
7.2.220.0070.00715.59
7.2.210.0100.00715.15
7.2.200.0040.00715.18
7.2.190.0040.01115.17
7.2.180.0090.00315.02
7.2.170.0030.01015.17
7.2.60.0100.00717.22
7.2.00.0060.00619.77
7.1.330.0030.01016.06
7.1.320.0070.00716.14
7.1.310.0120.00615.54
7.1.300.0040.01215.70
7.1.290.0040.00816.01
7.1.280.0080.00815.72
7.1.270.0030.00715.70
7.1.260.0000.00915.80
7.1.200.0070.00716.01
7.1.100.0030.00918.47
7.1.70.0000.00817.31
7.1.60.0060.01919.46
7.1.50.0040.00817.04
7.1.00.0070.07322.66
7.0.200.0040.01216.95
7.0.140.0100.06722.24
7.0.100.0100.03720.15
7.0.90.0030.08020.13
7.0.80.0030.05320.13
7.0.70.0100.03720.09
7.0.60.0070.08320.22
7.0.50.0070.04020.45
7.0.40.0070.03320.17
7.0.30.0030.04020.17
7.0.20.0130.06720.15
7.0.10.0030.04720.19
7.0.00.0030.04320.02
5.6.280.0030.07320.95
5.6.250.0030.07720.77
5.6.240.0170.07320.72
5.6.230.0130.03720.74
5.6.220.0070.06020.64
5.6.210.0030.05020.78
5.6.200.0000.04721.26
5.6.190.0030.04321.16
5.6.180.0100.05721.10
5.6.170.0000.05021.17
5.6.160.0030.04321.13
5.6.150.0030.04321.19
5.6.140.0070.05721.25
5.6.130.0100.05321.16
5.6.120.0070.04021.10
5.6.110.0070.05721.16
5.6.100.0070.03720.98
5.6.90.0130.05321.11
5.6.80.0070.06720.52
5.6.70.0000.06020.66
5.6.60.0200.05020.46
5.6.50.0170.07320.47
5.6.40.0100.08020.52
5.6.30.0100.08320.37
5.6.20.0070.04020.46
5.6.10.0030.04320.49
5.6.00.0070.08020.52
5.5.380.0070.06720.61
5.5.370.0170.05720.61
5.5.360.0030.04320.49
5.5.350.0070.06320.48
5.5.340.0030.04320.79
5.5.330.0000.05720.96
5.5.320.0070.05021.04
5.5.310.0030.03720.91
5.5.300.0030.04321.04
5.5.290.0070.04320.86
5.5.280.0070.03320.77
5.5.270.0100.03721.00
5.5.260.0100.03720.97
5.5.250.0000.05020.77
5.5.240.0100.07720.34
5.5.230.0100.08020.17
5.5.220.0170.07320.27
5.5.210.0030.06320.32
5.5.200.0100.04320.28
5.5.190.0200.06720.36
5.5.180.0100.07720.05
5.5.160.0100.07720.39
5.5.150.0000.05020.16
5.5.140.0170.06720.24
5.5.130.0100.07320.28
5.5.120.0130.04020.14
5.5.110.0130.08020.34
5.5.100.0230.06020.14
5.5.90.0130.07020.22
5.5.80.0070.08020.23
5.5.70.0070.08020.21
5.5.60.0130.07320.02
5.5.50.0130.05019.99
5.5.40.0100.06020.25
5.5.30.0130.08020.00
5.5.20.0130.07320.08
5.5.10.0030.08020.10
5.5.00.0170.07020.09
5.4.450.0070.03719.26
5.4.440.0170.03319.54
5.4.430.0030.03719.61
5.4.420.0030.04719.44
5.4.410.0100.05719.49
5.4.400.0070.05718.97
5.4.390.0000.09019.12
5.4.380.0100.07019.07
5.4.370.0130.03018.91
5.4.360.0070.08019.20
5.4.350.0230.05719.03
5.4.340.0000.07019.25
5.4.320.0130.07319.03
5.4.310.0030.07019.09
5.4.300.0170.07319.13
5.4.290.0130.03319.09
5.4.280.0100.08318.93
5.4.270.0100.07319.13
5.4.260.0100.07318.93
5.4.250.0000.05019.13
5.4.240.0100.07719.26
5.4.230.0070.07719.11
5.4.220.0100.07319.23
5.4.210.0070.07319.13
5.4.200.0100.07019.23
5.4.190.0100.06018.99
5.4.180.0070.05319.12
5.4.170.0070.08019.11
5.4.160.0070.06719.05
5.4.150.0130.07718.88
5.4.140.0130.07016.40
5.4.130.0100.06716.51
5.4.120.0100.05016.54
5.4.110.0070.07016.61
5.4.100.0070.06316.61
5.4.90.0000.05016.61
5.4.80.0070.07316.46
5.4.70.0070.07016.39
5.4.60.0070.05316.53
5.4.50.0030.08316.33
5.4.40.0100.07316.43
5.4.30.0070.07716.52
5.4.20.0100.06316.33
5.4.10.0070.07716.33
5.4.00.0030.04315.96
5.3.290.0000.06714.70
5.3.280.0100.07314.63
5.3.270.0070.07314.68
5.3.260.0100.04014.63
5.3.250.0200.06714.69
5.3.240.0030.04714.56
5.3.230.0130.07014.68
5.3.220.0000.09314.60
5.3.210.0130.07014.65
5.3.200.0100.07714.55
5.3.190.0070.07314.52
5.3.180.0100.07714.56
5.3.170.0130.07014.55
5.3.160.0100.07014.64
5.3.150.0070.07314.57
5.3.140.0030.06314.63
5.3.130.0070.06014.52
5.3.120.0130.07714.54
5.3.110.0100.07314.55
5.3.100.0230.06013.99
5.3.90.0170.05313.93
5.3.80.0200.07014.10
5.3.70.0100.04013.88
5.3.60.0030.04013.99
5.3.50.0030.05713.95
5.3.40.0200.06014.03
5.3.30.0130.06313.77
5.3.20.0070.06713.68
5.3.10.0030.05313.60
5.3.00.0030.07713.50
5.2.170.0030.06711.16
5.2.160.0070.05011.20
5.2.150.0100.06011.07
5.2.140.0070.03311.22
5.2.130.0000.03711.05
5.2.120.0100.06311.18
5.2.110.0100.05711.06
5.2.100.0000.03311.18
5.2.90.0070.02711.05
5.2.80.0000.05711.16
5.2.70.0170.05011.01
5.2.60.0070.05311.13
5.2.50.0030.05311.07
5.2.40.0100.05310.92
5.2.30.0100.04710.95
5.2.20.0100.05310.85
5.2.10.0000.06310.90
5.2.00.0000.06310.77
5.1.60.0030.05010.31
5.1.50.0070.05310.31
5.1.40.0030.03010.31
5.1.30.0000.06310.49
5.1.20.0000.03010.50
5.1.10.0000.02710.31
5.1.00.0100.05310.31
5.0.50.0130.04710.31
5.0.40.0000.05310.31
5.0.30.0000.06710.31
5.0.20.0070.04010.31
5.0.10.0070.04010.31
5.0.00.0030.04010.31
4.4.90.0000.02310.31
4.4.80.0030.02710.31
4.4.70.0030.03710.31
4.4.60.0030.02710.31
4.4.50.0070.03310.31
4.4.40.0070.05010.31
4.4.30.0000.01710.31
4.4.20.0030.01710.31
4.4.10.0070.03010.31
4.4.00.0070.05010.31
4.3.110.0030.03310.31
4.3.100.0000.04010.31
4.3.90.0030.03310.31
4.3.80.0000.04010.31
4.3.70.0070.03010.31
4.3.60.0100.02310.31
4.3.50.0030.03710.31
4.3.40.0070.05310.31
4.3.30.0030.03010.31
4.3.20.0000.03310.31
4.3.10.0000.04010.31
4.3.00.0030.03310.31

preferences:
36.49 ms | 400 KiB | 5 Q