3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* $fp = fsockopen("www.independenttrucks.com", 80, $errno, $errstr, 30); socket_set_option($fp, SOL_SOCKET, SO_SNDBUF, 1); if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { fwrite($fp, "GET / HTTP/1.1\r\nHost:www.independenttrucks.com\r\nUser-Agent:Mozilla 5.0\r\n\r\n"); while (!feof($fp)) { echo fgets($fp, 100); } fclose($fp); } echo "DOne" */ while (True) { error_reporting(E_ALL); echo "<h2>TCP/IP Connection</h2>\n"; /* Get the port for the WWW service. */ $service_port = getservbyname('www', 'tcp'); /* Get the IP address for the target host. */ $address = gethostbyname('elearning.delasalle.vic.edu.au'); #$address = gethostbyname('www.google.com'); #$address = gethostbyname('www.independenttrucks.com'); /* Create a TCP/IP socket. */ $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); socket_set_option($socket, SOL_SOCKET, SO_SNDBUF, 1); if ($socket === false) { echo "socket_create() failed: reason: " . socket_strerror(socket_last_error()) . "\n"; } else { echo "OK.\n"; } echo "Attempting to connect to '$address' on port '$service_port'..."; $result = socket_connect($socket, $address, $service_port); if ($result === false) { echo "socket_connect() failed.\nReason: ($result) " . socket_strerror(socket_last_error($socket)) . "\n"; } else { echo "OK.\n"; } $in = "GET /moodle/login/index.php HTTP/1.1\r\n"; #$in = "GET / HTTP/1.1\r\n"; $in .= "Host:elearning.delasalle.vic.edu.au\r\n"; #$in .= "Host:www.independenttrucks.com\r\n"; $in .= "User-Agent:Mozilla 5.0\r\n\r\n"; $out = ''; echo "Sending HTTP GET request..."; socket_write($socket, $in, strlen($in)); echo "OK.\n"; echo "Reading response:\n\n"; while ($out = socket_read($socket, 10000)) { echo $out; } echo "\nClosing socket..."; socket_close($socket); echo "OK.\n\n"; } ?>

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.0110.00416.88
8.3.50.0060.00918.05
8.3.40.0110.00419.14
8.3.30.0120.00319.08
8.3.20.0030.00520.55
8.3.10.0080.00023.89
8.3.00.0060.00319.76
8.2.180.0180.00317.00
8.2.170.0080.00822.96
8.2.160.0110.00320.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00020.64
8.2.120.0050.00326.35
8.2.110.0070.00319.30
8.2.100.0120.00017.88
8.2.90.0080.00019.35
8.2.80.0000.00817.97
8.2.70.0050.00317.75
8.2.60.0040.00418.16
8.2.50.0090.00018.07
8.2.40.0000.01219.69
8.2.30.0040.00420.86
8.2.20.0060.00317.80
8.2.10.0040.00418.15
8.2.00.0070.00018.22
8.1.280.0100.01025.92
8.1.270.0040.00424.09
8.1.260.0040.00428.09
8.1.250.0050.00328.09
8.1.240.0060.00324.09
8.1.230.0090.00317.48
8.1.220.0080.00017.78
8.1.210.0040.00418.77
8.1.200.0030.00717.36
8.1.190.0000.00817.77
8.1.180.0000.00818.10
8.1.170.0040.00418.75
8.1.160.0000.00722.03
8.1.150.0060.00618.95
8.1.140.0050.00319.74
8.1.130.0040.00417.86
8.1.120.0070.00017.63
8.1.110.0040.00417.55
8.1.100.0000.00817.45
8.1.90.0030.00517.61
8.1.80.0080.00017.39
8.1.70.0000.00817.47
8.1.60.0030.00617.68
8.1.50.0000.00817.75
8.1.40.0060.00317.52
8.1.30.0040.00417.86
8.1.20.0060.00317.74
8.1.10.0040.00417.61
8.1.00.0000.00917.75
8.0.300.0070.00018.77
8.0.290.0040.00417.00
8.0.280.0000.00718.52
8.0.270.0000.00717.48
8.0.260.0070.00017.40
8.0.250.0000.00717.06
8.0.240.0040.00417.01
8.0.230.0000.00717.08
8.0.220.0040.00416.96
8.0.210.0000.00817.03
8.0.200.0030.00317.01
8.0.190.0050.00317.07
8.0.180.0040.00417.04
8.0.170.0000.00917.04
8.0.160.0040.00417.08
8.0.150.0000.01117.08
8.0.140.0000.00716.82
8.0.130.0030.00313.61
8.0.120.0050.00516.94
8.0.110.0040.00416.99
8.0.100.0040.00416.91
8.0.90.0040.00417.01
8.0.80.0120.00417.19
8.0.70.0000.00817.07
8.0.60.0040.00417.11
8.0.50.0030.00517.11
8.0.30.0140.00817.29
8.0.20.0130.00917.43
8.0.10.0030.00517.13
8.0.00.0090.00917.02
7.4.330.0050.00017.02
7.4.320.0000.00716.66
7.4.300.0000.00716.75
7.4.290.0030.00316.63
7.4.280.0030.00616.71
7.4.270.0060.00316.76
7.4.260.0030.00316.72
7.4.250.0040.00416.84
7.4.240.0030.00416.83
7.4.230.0070.00016.66
7.4.220.0160.00716.86
7.4.210.0060.00916.66
7.4.200.0030.00516.57
7.4.160.0060.01016.61
7.4.150.0120.00617.40
7.4.140.0140.01017.86
7.4.130.0100.01116.67
7.4.120.0100.00916.74
7.4.110.0070.01116.59
7.4.100.0100.01316.63
7.4.90.0130.00716.83
7.4.80.0120.00919.39
7.4.70.0100.00716.80
7.4.60.0060.01216.93
7.4.50.0100.00616.80
7.4.40.0180.00916.83
7.4.30.0080.01516.61
7.4.00.0110.00715.20
7.3.330.0030.00313.23
7.3.320.0050.00013.22
7.3.310.0040.00416.37
7.3.300.0000.00716.52
7.3.290.0080.00916.50
7.3.280.0110.00716.46
7.3.270.0150.00317.40
7.3.260.0090.01416.76
7.3.250.0070.01416.56
7.3.240.0110.00716.63
7.3.230.0130.00916.45
7.3.210.0070.01116.45
7.3.200.0130.01016.78
7.3.190.0170.00916.76
7.3.180.0150.00416.59
7.3.170.0110.01416.80
7.3.160.0110.01116.67
7.3.120.0160.00015.02
7.3.110.0060.00914.71
7.3.100.0000.01614.96
7.3.90.0120.00314.85
7.3.80.0040.01215.21
7.3.70.0060.00615.05
7.3.60.0090.00315.02
7.3.50.0000.01214.85
7.3.40.0100.00715.17
7.3.30.0060.01014.89
7.3.20.0070.01116.87
7.3.10.0140.00316.78
7.3.00.0040.01116.79
7.2.330.0110.00816.72
7.2.320.0060.01217.01
7.2.310.0050.01416.62
7.2.300.0090.01216.60
7.2.290.0130.00616.72
7.2.240.0100.00715.26
7.2.230.0120.00315.33
7.2.220.0090.00315.22
7.2.210.0150.00015.29
7.2.200.0060.00615.25
7.2.190.0000.01515.02
7.2.180.0090.00614.89
7.2.170.0090.00615.28
7.2.160.0110.00415.05
7.2.150.0120.00616.92
7.2.140.0030.01016.80
7.2.130.0040.01116.96
7.2.120.0040.01116.84
7.2.110.0100.00317.08
7.2.100.0070.01017.06
7.2.90.0100.00717.11
7.2.80.0000.01417.06
7.2.70.0060.00916.80
7.2.60.0140.00117.17
7.2.50.0120.00617.25
7.2.40.0100.00717.19
7.2.30.0120.00617.05
7.2.20.0000.01217.07
7.2.10.0100.00716.98
7.2.00.0100.00818.28
7.1.330.0060.00916.02
7.1.320.0040.01415.73
7.1.310.0070.00716.18
7.1.300.0060.00915.82
7.1.290.0080.00615.86
7.1.280.0030.01215.83
7.1.270.0060.01015.72
7.1.260.0030.01215.61
7.1.250.0080.00816.00
7.1.200.0060.00915.88
7.1.100.0030.01018.21
7.1.70.0040.01217.07
7.1.60.0070.02019.36
7.1.50.0070.02016.96
7.1.00.0100.06722.74
7.0.200.0030.00617.04
7.0.60.0170.06720.21
7.0.50.0070.08018.10
7.0.40.0100.07720.53
7.0.30.0270.05320.43
7.0.20.0300.07720.54
7.0.10.0130.07720.41
7.0.00.0000.05020.44
5.6.210.0000.05720.79
5.6.200.0000.09018.41
5.6.190.0030.04321.10
5.6.180.0430.06720.90
5.6.170.0430.06020.80
5.6.160.0200.06320.83
5.6.150.0030.06018.43
5.6.140.0170.06018.42
5.6.130.0000.04318.67
5.6.120.0100.03321.27
5.6.110.0170.07721.44
5.6.100.0100.05021.26
5.6.90.0100.08021.32
5.6.80.0100.03320.84
5.5.350.0230.07320.60
5.5.340.0030.04318.36
5.5.330.0030.08720.82
5.5.320.0070.08020.62
5.5.310.0130.05020.63
5.5.300.0100.07718.31
5.5.290.0230.05718.26
5.5.280.0230.04321.25
5.5.270.0200.03321.25
5.5.260.0170.06321.09
5.5.250.0130.08020.91
5.5.240.0230.07020.48

preferences:
58.75 ms | 400 KiB | 5 Q