3v4l.org

run code in 300+ PHP versions simultaneously
<?php require 'server.inc'; function do_test($version, $connection) { $options = array( 'http' => array( 'protocol_version' => $version, ) ); if ($connection) { $options['http']['header'] = "Connection: $connection"; } $ctx = stream_context_create($options); $responses = ["data://text/plain,HTTP/$version 204 No Content\r\n\r\n"]; $pid = http_server('tcp://127.0.0.1:12342', $responses, $output); $fd = fopen('http://127.0.0.1:12342/', 'rb', false, $ctx); fseek($output, 0, SEEK_SET); echo stream_get_contents($output); http_server_kill($pid); } echo "HTTP/1.0, default behaviour:\n"; do_test('1.0', null); echo "HTTP/1.0, connection: close:\n"; do_test('1.0', 'close'); echo "HTTP/1.0, connection: keep-alive:\n"; do_test('1.0', 'keep-alive'); echo "HTTP/1.1, default behaviour:\n"; do_test('1.1', null); echo "HTTP/1.1, connection: close:\n"; do_test('1.1', 'close'); echo "HTTP/1.1, connection: keep-alive:\n"; do_test('1.1', 'keep-alive'); ?>

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.70.0190.00316.75
8.3.60.0080.01116.88
8.3.50.0160.00722.02
8.3.40.0180.00318.97
8.3.30.0110.00418.86
8.3.20.0080.00020.38
8.3.10.0050.00321.77
8.3.00.0030.00517.92
8.2.180.0110.00418.79
8.2.170.0030.01222.96
8.2.160.0140.00020.39
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0110.00420.60
8.2.110.0050.00522.29
8.2.100.0100.00318.18
8.2.90.0040.00419.17
8.2.80.0000.00917.97
8.2.70.0030.00517.75
8.2.60.0040.00418.03
8.2.50.0050.00318.07
8.2.40.0000.01018.22
8.2.30.0050.00318.09
8.2.20.0050.00317.72
8.2.10.0000.00818.19
8.2.00.0000.00717.69
8.1.280.0100.01025.92
8.1.270.0030.00622.11
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0060.00323.96
8.1.230.0060.00619.00
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0040.00417.23
8.1.190.0000.00817.53
8.1.180.0040.00418.70
8.1.170.0000.01218.66
8.1.160.0000.00722.07
8.1.150.0000.00718.75
8.1.140.0000.00817.35
8.1.130.0070.00017.83
8.1.120.0030.00517.43
8.1.110.0000.00717.43
8.1.100.0050.00317.30
8.1.90.0070.00017.32
8.1.80.0000.00817.44
8.1.70.0000.00717.38
8.1.60.0030.00617.48
8.1.50.0070.00017.45
8.1.40.0000.00817.52
8.1.30.0060.00317.65
8.1.20.0000.00817.60
8.1.10.0060.00317.50
8.1.00.0080.00017.51
8.0.300.0000.00718.77
8.0.290.0060.00317.05
8.0.280.0070.00018.53
8.0.270.0000.00717.38
8.0.260.0030.00317.35
8.0.250.0000.00717.06
8.0.240.0040.00417.10
8.0.230.0090.00016.97
8.0.220.0030.00317.00
8.0.210.0000.00717.00
8.0.200.0030.00517.09
8.0.190.0000.00717.14
8.0.180.0040.00417.02
8.0.170.0000.00817.07
8.0.160.0050.00217.00
8.0.150.0040.00417.02
8.0.140.0030.00416.88
8.0.130.0000.00613.46
8.0.120.0000.00717.05
8.0.110.0040.00417.03
8.0.100.0040.00416.94
8.0.90.0000.00817.02
8.0.80.0040.01216.96
8.0.70.0070.00016.92
8.0.60.0000.00717.05
8.0.50.0050.00216.96
8.0.30.0080.01217.04
8.0.20.0070.01417.41
8.0.10.0080.00017.15
8.0.00.0140.01016.75
7.4.330.0020.00215.21
7.4.320.0000.00616.57
7.4.300.0000.00616.53
7.4.290.0070.00016.52
7.4.280.0040.00416.53
7.4.270.0000.00716.65
7.4.260.0050.00316.63
7.4.250.0030.00316.56
7.4.240.0040.00316.59
7.4.230.0070.00016.44
7.4.220.0090.00916.69
7.4.210.0110.00716.55
7.4.200.0040.00416.62
7.4.160.0000.01516.46
7.4.150.0090.00917.40
7.4.140.0100.01017.86
7.4.130.0150.00316.34
7.4.120.0100.00716.61
7.4.110.0070.01116.27
7.4.100.0070.01116.50
7.4.90.0100.00716.38
7.4.80.0110.00619.39
7.4.70.0100.01316.39
7.4.60.0130.00316.63
7.4.50.0030.00616.32
7.4.40.0100.00716.38
7.4.30.0060.00916.46
7.4.00.0070.00715.04
7.3.330.0000.00613.19
7.3.320.0000.00513.15
7.3.310.0030.00316.35
7.3.300.0070.00016.21
7.3.290.0030.01216.33
7.3.280.0090.00716.34
7.3.270.0130.00317.40
7.3.260.0180.00616.39
7.3.240.0030.01816.29
7.3.230.0040.01316.62
7.3.210.0120.00316.65
7.3.200.0130.00819.39
7.3.190.0130.00916.45
7.3.180.0110.00616.36
7.3.170.0100.00616.36
7.3.160.0120.00316.34
7.2.330.0030.01416.74
7.2.320.0170.00016.60
7.2.310.0110.00616.47
7.2.300.0170.00316.45
7.2.290.0170.00016.70
7.2.00.0040.00819.12
7.1.200.0040.00715.79
7.1.100.0030.00918.10
7.1.70.0040.00416.91
7.1.60.0100.01419.29
7.1.50.0070.01016.68
7.1.00.0100.07022.36
7.0.200.0760.00314.83
7.0.140.0000.05322.21
7.0.60.0070.06319.88
7.0.50.0000.08717.92
7.0.40.0030.09720.24
7.0.30.0270.08320.07
7.0.20.0300.08320.24
7.0.10.0070.07720.17
7.0.00.0030.05320.07
5.6.280.0100.06321.08
5.6.210.0070.04020.53
5.6.200.0000.04318.30
5.6.190.0100.08720.68
5.6.180.0300.07720.42
5.6.170.0300.05320.46
5.6.160.0130.03020.63
5.6.150.0030.07718.20
5.6.140.0000.05018.16
5.6.130.0100.08318.17
5.6.120.0000.09321.09
5.6.110.0230.05021.14
5.6.100.0170.07721.01
5.6.90.0070.08020.95
5.6.80.0070.05320.29
5.5.350.0200.05020.53
5.5.340.0170.05717.98
5.5.330.0070.04720.41
5.5.320.0230.05020.31
5.5.310.0230.05320.36
5.5.300.0030.04018.00
5.5.290.0030.04018.05
5.5.280.0270.06320.66
5.5.270.0070.04720.80
5.5.260.0100.08020.88
5.5.250.0100.04320.69
5.5.240.0070.07720.26
5.4.450.0200.06319.46
5.4.440.0230.04319.45
5.4.430.0070.06019.70
5.4.420.0300.06319.51
5.4.410.0100.05019.34
5.4.400.0000.06019.07
5.4.390.0100.05019.24
5.4.380.0070.06318.75
5.4.370.0200.04718.75
5.4.360.0170.05018.85
5.4.350.0030.03713.80
5.4.340.0100.03013.78
5.4.320.0070.04714.28
5.4.310.0130.03014.27
5.4.300.0030.04014.21
5.4.290.0030.04014.43
5.4.280.0130.03714.29
5.4.270.0070.04014.18
5.4.260.0070.04014.11
5.4.250.0130.03714.17
5.4.240.0070.03714.23
5.4.230.0070.04314.01
5.4.220.0070.04314.14
5.4.210.0100.04014.11
5.4.200.0030.04014.28
5.4.190.0130.03314.22
5.4.180.0130.03014.11
5.4.170.0030.05314.18
5.4.160.0100.04714.09
5.4.150.0130.04714.18
5.4.140.0070.05314.07
5.4.130.0070.05013.83
5.4.120.0070.04013.78
5.4.110.0200.04313.73
5.4.100.0130.05013.71
5.4.90.0130.04013.76
5.4.80.0100.04013.86
5.4.70.0130.04313.73
5.4.60.0170.03313.84
5.4.50.0130.04013.93
5.4.40.0030.04713.79
5.4.30.0230.03313.92
5.4.20.0200.04313.71
5.4.10.0070.05713.88
5.4.00.0170.04713.23
5.3.290.0100.06014.80
5.3.280.0100.04714.75
5.3.270.0070.05714.60
5.3.260.0170.04014.53
5.3.250.0100.04714.52
5.3.240.0100.05314.74
5.3.230.0130.05314.75
5.3.220.0230.04714.52
5.3.210.0200.04014.50
5.3.200.0100.05314.76
5.3.190.0130.04314.49
5.3.180.0070.04714.63
5.3.170.0030.04314.55
5.3.160.0070.04314.72
5.3.150.0000.05314.74
5.3.140.0070.04314.52
5.3.130.0030.06014.68
5.3.120.0030.05314.57
5.3.110.0070.05314.46
5.3.100.0030.04313.96
5.3.90.0070.04013.96
5.3.80.0030.04013.97
5.3.70.0070.04314.19
5.3.60.0100.04714.13
5.3.50.0130.04313.95
5.3.40.0070.05314.03
5.3.30.0100.05014.01
5.3.20.0130.04313.76
5.3.10.0170.04313.77
5.3.00.0130.04713.71
5.2.170.0070.03311.29
5.2.160.0030.04311.13
5.2.150.0170.03711.18
5.2.140.0000.05311.18
5.2.130.0100.04311.13
5.2.120.0030.03311.02
5.2.110.0030.03711.13
5.2.100.0170.03711.14
5.2.90.0170.03711.08
5.2.80.0370.03711.24
5.2.70.0070.04011.03
5.2.60.0270.02011.05
5.2.50.0100.03311.14
5.2.40.0070.03711.06
5.2.30.0070.04010.89
5.2.20.0100.03311.03
5.2.10.0100.03311.02
5.2.00.0130.03710.65
5.1.60.0030.03310.13
5.1.50.0070.0379.97
5.1.40.0030.04010.00
5.1.30.0000.04010.39
5.1.20.0100.03310.51
5.1.10.0030.03710.05
5.1.00.0070.03310.05
5.0.50.0030.0278.53
5.0.40.0030.0278.60
5.0.30.0000.0438.19
5.0.20.0030.0238.17
5.0.10.0070.0238.19
5.0.00.0030.0408.13
4.4.90.0130.0135.84
4.4.80.0030.0205.83
4.4.70.0030.0235.91
4.4.60.0030.0235.84
4.4.50.0130.0135.91
4.4.40.0070.0275.83
4.4.30.0030.0205.86
4.4.20.0000.0236.05
4.4.10.0030.0275.90
4.4.00.0000.0335.96
4.3.110.0000.0235.77
4.3.100.0000.0235.88
4.3.90.0000.0235.77
4.3.80.0000.0335.91
4.3.70.0000.0235.73
4.3.60.0000.0235.75
4.3.50.0000.0235.72
4.3.40.0000.0335.69
4.3.30.0000.0204.59
4.3.20.0100.0134.49
4.3.10.0000.0234.45
4.3.00.0030.0206.93

preferences:
139.58 ms | 401 KiB | 5 Q