3v4l.org

run code in 300+ PHP versions simultaneously
<?php print_r($_POST); require_once "tcp_ping.class.php"; $pinger = new TcpPingWrapper(); $strAccept = isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ''; $strUA = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; if (strpos($strAccept, "application/xhtml+xml") !== false || stristr($strUA, "validator") !== false) { $content_type = 'application/xhtml+xml'; } else { $content_type = 'text/html'; } header("Content-Type: " . $content_type . "; charset=utf-8;"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>TCP Ping Example</title> <meta http-equiv="Content-Type" content="<?php echo $content_type?>; charset=utf-8;" /> <meta name="description" content="TCP Ping example by Andronicus Riyono" /> <meta name="keywords" content="andronicus, riyono, tcp ping, ping, tcp, php, sockets, socket" /> <style type="text/css"> body { font-family: "Trebuchet MS", Tahoma, Arial, Helvetica, sans-serif; } a img { border:0; } table, tr, th, td { border: 1px solid #039; border-collapse: collapse; } th, td { padding: .5em; } </style> </head> <body> <?php if (isset($_POST['multiple'])) { $_REQUEST['hosts'] = preg_split("/\s+/", $_POST['multiple'], 10, PREG_SPLIT_NO_EMPTY); } ?> <h1>Connectivity Ping</h1> <p>Enter up to 10 hostname or IP address you would like to ping on the textarea. One host or IP address per line. Hit the ping button to execute the TCP Connectivity Ping.</p> <p>The TCP Connectivity Ping will try to determine whether a host is alive or dead by sending NOOP Command to Common TCP Service (http, ftp, telnet, mail, in that order).</p> <form action="<?php echo $_SERVER['PHP_SELF']?>" method="post"> <div><textarea id="multiple" name="multiple" rows="10" cols="40"><?php if (isset($_POST['multiple'])) { echo $_POST['multiple']; } ?></textarea></div> <div><input id="submit" name="submit" type="submit" value="Ping" /></div> </form> <?php if (isset($_REQUEST['hosts'])) { $pinger->ReadFormInput(); $pinger->Ping(); ?> <h2>Connectivity Ping Result</h2> <h3>Text only (&lt;pre&gt; is used here)</h3> <pre> <?php $pinger->DisplayOutputAsText(); ?> </pre> <h3>Ordinary HTML</h3> <?php $pinger->DisplayOutputAsHtml(); ?> <h3>Ordinary HTML table</h3> <?php $pinger->DisplayOutputAsHtmlTable(); ?> <h3>Fancy HTML table</h3> <?php $pinger->DisplayOutputAsHtmlFancy(); ?> <?php } ?> <p> <a href="http://validator.w3.org/check?uri=referer"><img src="http://riyono.com/images/valid-xhtml10.png" alt="Valid XHTML 1.0!" height="15" width="80" /></a> </p> <address>Copyright (c) 2005 Andronicus Riyono &lt;nick@riyono.com&gt;</address> </body> </html>

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)
8.3.60.0160.00318.43
8.3.50.0210.00821.98
8.3.40.0040.01118.96
8.3.30.0130.00319.18
8.3.20.0080.00020.34
8.3.10.0090.00023.48
8.3.00.0080.00020.63
8.2.180.0040.01116.75
8.2.170.0070.00722.96
8.2.160.0070.00722.11
8.2.150.0050.00324.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00020.89
8.2.110.0030.00622.37
8.2.100.0070.00418.03
8.2.90.0050.00319.11
8.2.80.0050.00318.04
8.2.70.0040.00417.63
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0000.00818.22
8.2.30.0070.00018.21
8.2.20.0000.00817.79
8.2.10.0000.00817.69
8.2.00.0040.00417.67
8.1.280.0140.00725.92
8.1.270.0040.00423.91
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0090.00022.53
8.1.230.0120.00017.89
8.1.220.0050.00317.77
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0080.00017.53
8.1.180.0030.00518.10
8.1.170.0030.00618.69
8.1.160.0040.00421.98
8.1.150.0040.00418.69
8.1.140.0000.00717.41
8.1.130.0070.00017.83
8.1.120.0000.00817.45
8.1.110.0080.00017.46
8.1.100.0080.00017.49
8.1.90.0000.00817.42
8.1.80.0040.00417.52
8.1.70.0000.00717.48
8.1.60.0030.00517.65
8.1.50.0050.00317.50
8.1.40.0000.00817.52
8.1.30.0000.00817.71
8.1.20.0000.00817.73
8.1.10.0040.00417.64
8.1.00.0000.00817.47
8.0.300.0030.00318.77
8.0.290.0000.00717.29
8.0.280.0000.00718.48
8.0.270.0030.00317.27
8.0.260.0030.00517.02
8.0.250.0030.00317.11
8.0.240.0040.00417.16
8.0.230.0000.00717.18
8.0.220.0040.00417.11
8.0.210.0020.00517.10
8.0.200.0000.00617.16
8.0.190.0040.00417.19
8.0.180.0020.00517.08
8.0.170.0040.00416.95
8.0.160.0000.00717.04
8.0.150.0030.00617.02
8.0.140.0000.00716.91
8.0.130.0000.00613.59
8.0.120.0050.00317.05
8.0.110.0040.00416.97
8.0.100.0000.00717.05
8.0.90.0000.00717.13
8.0.80.0090.00617.04
8.0.70.0000.00817.20
8.0.60.0000.00717.08
8.0.50.0080.00016.90
8.0.30.0090.00917.15
8.0.20.0100.01317.40
8.0.10.0000.00717.05
8.0.00.0160.00616.78
7.4.330.0030.00315.10
7.4.320.0030.00316.55
7.4.300.0030.00316.67
7.4.290.0030.00316.59
7.4.280.0080.00016.66
7.4.270.0070.00016.61
7.4.260.0040.00416.55
7.4.250.0040.00416.53
7.4.240.0050.00216.61
7.4.230.0070.00016.77
7.4.220.0090.00916.61
7.4.210.0090.00816.56
7.4.200.0050.00316.57
7.4.190.0040.00416.84
7.4.160.0040.01216.56
7.4.150.0000.01817.40
7.4.140.0090.00917.86
7.4.130.0120.00716.42
7.4.120.0110.00816.59
7.4.110.0100.00716.57
7.4.100.0060.01216.69
7.4.90.0180.00416.46
7.4.80.0130.00316.60
7.4.70.0130.01016.65
7.4.60.0140.00316.48
7.4.50.0040.00416.36
7.4.40.0100.00322.77
7.4.30.0030.01316.71
7.4.00.0110.00715.15
7.3.330.0060.00013.21
7.3.320.0020.00213.04
7.3.310.0020.00516.29
7.3.300.0070.00016.34
7.3.290.0040.01116.30
7.3.280.0050.01116.34
7.3.270.0120.01317.40
7.3.260.0040.01316.55
7.3.250.0120.00516.36
7.3.240.0140.00216.36
7.3.230.0110.00616.57
7.3.210.0070.01416.30
7.3.200.0140.00719.39
7.3.190.0070.01316.45
7.3.180.0070.00716.42
7.3.170.0090.00616.37
7.3.160.0070.01416.35
7.3.120.0030.01314.99
7.3.110.0080.00814.89
7.3.100.0060.00714.83
7.3.90.0060.00614.78
7.3.80.0070.00514.81
7.3.70.0060.00914.76
7.3.60.0080.00714.78
7.3.50.0080.00514.72
7.3.40.0070.00514.81
7.3.30.0080.00614.76
7.3.20.0060.00716.69
7.3.10.0050.01116.61
7.3.00.0060.00816.51
7.2.330.0090.00916.65
7.2.320.0130.00916.73
7.2.310.0090.00916.73
7.2.300.0130.00716.53
7.2.290.0130.00316.72
7.2.250.0120.00714.98
7.2.240.0090.00915.15
7.2.230.0060.00914.97
7.2.220.0050.01014.98
7.2.210.0050.01015.01
7.2.200.0050.00915.06
7.2.190.0100.00415.06
7.2.180.0090.00515.06
7.2.170.0080.00615.04
7.2.80.0030.00916.40
7.2.60.0060.00616.89
7.1.330.0040.01115.56
7.1.320.0090.00315.69
7.1.310.0090.00715.73
7.1.300.0070.00515.64
7.1.290.0080.00515.72
7.1.280.0060.00715.68
7.1.270.0080.00315.58
7.1.260.0080.00315.58
7.1.200.0040.00415.68
7.1.70.0070.00717.14
7.1.60.0210.00319.32
7.1.50.0170.02134.65
7.1.00.0100.07022.48
7.0.200.0000.01016.14
7.0.140.0100.06722.00
7.0.100.0100.08019.96
7.0.90.0000.08719.90
7.0.80.0070.07719.85
7.0.70.0170.03719.96
7.0.60.0100.07719.93
7.0.50.0070.08020.35
7.0.40.0100.07320.01
7.0.30.0100.08720.02
7.0.20.0030.08719.99
7.0.10.0230.07319.89
7.0.00.0030.08020.05
5.6.280.0030.07321.13
5.6.250.0130.07320.56
5.6.240.0100.08320.60
5.6.230.0100.08320.65
5.6.220.0100.06720.64
5.6.210.0130.07320.52
5.6.200.0070.04721.14
5.6.190.0130.07720.90
5.6.180.0100.07321.02
5.6.170.0100.07320.98
5.6.160.0070.07321.07
5.6.150.0100.05320.97
5.6.140.0170.07720.95
5.6.130.0030.07721.00
5.6.120.0030.09020.99
5.6.110.0100.08020.89
5.6.100.0030.05021.01
5.6.90.0130.06721.05
5.6.80.0100.07020.46
5.6.70.0100.07320.29
5.6.60.0070.06020.28
5.6.50.0130.07320.39
5.6.40.0100.08320.28
5.6.30.0100.06720.27
5.6.20.0070.07720.45
5.6.10.0170.07720.38
5.6.00.0100.07020.31
5.5.380.0100.07720.42
5.5.370.0070.04320.29
5.5.360.0070.07720.52
5.5.350.0000.08320.41
5.5.340.0170.07020.87
5.5.330.0130.07320.70
5.5.320.0030.08720.75
5.5.310.0100.07720.69
5.5.300.0030.09020.88
5.5.290.0100.08320.79
5.5.280.0100.07020.81
5.5.270.0070.07320.68
5.5.260.0100.07320.76
5.5.250.0070.04020.58
5.5.240.0030.08019.99
5.5.230.0100.08020.06
5.5.220.0100.07720.25
5.5.210.0170.07020.24
5.5.200.0130.07720.15
5.5.190.0130.07720.21
5.5.180.0100.07720.12
5.5.160.0070.04020.24
5.5.150.0130.07320.14
5.5.140.0130.07320.10
5.5.130.0130.06720.23
5.5.120.0130.07320.20
5.5.110.0130.07020.07
5.5.100.0130.07320.04
5.5.90.0100.08020.04
5.5.80.0070.05320.09
5.5.70.0170.06320.02
5.5.60.0070.07720.07
5.5.50.0100.07020.02
5.5.40.0100.07320.05
5.5.30.0100.05720.10
5.5.20.0030.08020.04
5.5.10.0100.04719.96
5.5.00.0030.08720.00
5.4.450.0100.07719.57
5.4.440.0030.04719.36
5.4.430.0170.07019.31
5.4.420.0070.07319.36
5.4.410.0070.03319.32
5.4.400.0130.06318.83
5.4.390.0100.08319.08
5.4.380.0070.07719.13
5.4.370.0130.06318.99
5.4.360.0200.06019.03
5.4.350.0070.07718.91
5.4.340.0070.07019.14
5.4.320.0130.07319.11
5.4.310.0070.05719.04
5.4.300.0170.07018.98
5.4.290.0100.06318.95
5.4.280.0100.05319.15
5.4.270.0070.04718.97
5.4.260.0030.06019.15
5.4.250.0070.07719.15
5.4.240.0070.05718.97
5.4.230.0030.08319.06
5.4.220.0100.07319.04
5.4.210.0100.05718.95
5.4.200.0230.05319.06
5.4.190.0070.07019.17
5.4.180.0130.07318.96
5.4.170.0070.07319.23
5.4.160.0200.06319.06
5.4.150.0070.04719.08
5.4.140.0170.06016.23
5.4.130.0100.06716.27
5.4.120.0030.07716.24
5.4.110.0270.05316.27
5.4.100.0030.08316.36
5.4.90.0100.06716.46
5.4.80.0200.06016.43
5.4.70.0070.07316.36
5.4.60.0000.07716.32
5.4.50.0070.07016.42
5.4.40.0070.07316.25
5.4.30.0100.06716.24
5.4.20.0070.03316.37
5.4.10.0100.06716.40
5.4.00.0100.07015.73
5.3.290.0100.06714.69
5.3.280.0100.04014.50
5.3.270.0030.08014.61
5.3.260.0030.07314.59
5.3.250.0070.08014.59
5.3.240.0100.07014.59
5.3.230.0100.04014.56
5.3.220.0070.04314.43
5.3.210.0070.07714.58
5.3.200.0030.08014.53
5.3.190.0070.04014.45
5.3.180.0100.07014.43
5.3.170.0070.07314.46
5.3.160.0070.08014.57
5.3.150.0030.08014.55
5.3.140.0070.07314.53
5.3.130.0100.07314.54
5.3.120.0000.04714.44
5.3.110.0130.07314.56
5.3.100.0070.07014.02
5.3.90.0100.07014.01
5.3.80.0130.07314.00
5.3.70.0030.08314.03
5.3.60.0130.06714.02
5.3.50.0070.07313.93
5.3.40.0030.08013.96
5.3.30.0100.07013.87
5.3.20.0000.06713.71
5.3.10.0100.03713.67
5.3.00.0100.07313.65
5.2.170.0070.06011.09
5.2.160.0070.05711.17
5.2.150.0070.06010.99
5.2.140.0070.06710.96
5.2.130.0170.05310.98
5.2.120.0070.05711.13
5.2.110.0070.06310.95
5.2.100.0000.05010.99
5.2.90.0030.04710.98
5.2.80.0200.05011.08
5.2.70.0000.06711.14
5.2.60.0070.06011.14
5.2.50.0070.06311.07
5.2.40.0000.06010.88
5.2.30.0070.06311.05
5.2.20.0030.06310.99
5.2.10.0030.06310.80
5.2.00.0100.05710.68
5.1.60.0030.0439.90
5.1.50.0130.04310.04
5.1.40.0030.0509.84
5.1.30.0200.03710.27
5.1.20.0000.05710.43
5.1.10.0030.04710.16
5.1.00.0000.06310.11
5.0.50.0070.0438.65
5.0.40.0000.0438.53
5.0.30.0000.0708.53
5.0.20.0000.0478.53
5.0.10.0070.0408.53
5.0.00.0100.0478.53
4.4.90.0070.0308.53
4.4.80.0030.0308.53
4.4.70.0000.0408.53
4.4.60.0000.0378.53
4.4.50.0070.0338.53
4.4.40.0000.0508.53
4.4.30.0000.0408.53
4.4.20.0030.0378.53
4.4.10.0000.0408.53
4.4.00.0030.0278.53
4.3.110.0070.0308.53
4.3.100.0000.0378.53
4.3.90.0030.0338.53
4.3.80.0000.0278.53
4.3.70.0030.0338.53
4.3.60.0070.0308.53
4.3.50.0000.0408.53
4.3.40.0100.0438.53
4.3.30.0030.0378.53
4.3.20.0000.0378.53
4.3.10.0030.0338.53
4.3.00.0070.0308.53

preferences:
60.86 ms | 400 KiB | 5 Q