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)
5.4.370.0230.04718.75
5.4.360.0200.05018.51
5.4.350.0230.03313.77
5.4.340.0000.05313.85
5.4.320.0170.04014.25
5.4.310.0100.05014.27
5.4.300.0130.04714.50
5.4.290.0130.04714.22
5.4.280.0200.03714.22
5.4.270.0070.04014.40
5.4.260.0170.04014.18
5.4.250.0070.04314.16
5.4.240.0030.04014.23
5.4.230.0130.03014.28
5.4.220.0200.03314.17
5.4.210.0130.04314.21
5.4.200.0000.05014.15
5.4.190.0130.03714.16
5.4.180.0130.03714.16
5.4.170.0070.04014.09
5.4.160.0100.03714.17
5.4.150.0130.04314.14
5.4.140.0100.04313.85
5.4.130.0000.05014.06
5.4.120.0070.05013.79
5.4.110.0130.04313.90
5.4.100.0030.04013.78
5.4.90.0000.04713.79
5.4.80.0100.05013.90
5.4.70.0100.04713.78
5.4.60.0130.04013.77
5.4.50.0100.03713.79
5.4.40.0030.04013.76
5.4.30.0030.04013.91
5.4.20.0070.04013.76
5.4.10.0070.04713.70
5.4.00.0130.04313.26
5.3.290.0070.05714.58
5.3.280.0170.06014.52
5.3.270.0230.04014.57
5.3.260.0500.03714.74
5.3.250.0200.04714.74
5.3.240.0170.05314.58
5.3.230.0070.05314.73
5.3.220.0070.04714.70
5.3.210.0030.05314.66
5.3.200.0000.05014.55
5.3.190.0130.04014.61
5.3.180.0070.04314.50
5.3.170.0170.03014.52
5.3.160.0070.04714.50
5.3.150.0030.04014.56
5.3.140.0030.04714.73
5.3.130.0130.03714.50
5.3.120.0130.03314.53
5.3.110.0130.04014.73
5.3.100.0000.05014.17
5.3.90.0000.04314.12
5.3.80.0100.03714.14
5.3.70.0030.04314.14
5.3.60.0070.03714.03
5.3.50.0030.04314.09
5.3.40.0030.04014.11
5.3.30.0170.03713.84
5.3.20.0070.04013.73
5.3.10.0070.04713.76
5.3.00.0070.03713.62
5.2.170.0030.03311.26
5.2.160.0030.04311.18
5.2.150.0100.03711.20
5.2.140.0070.04011.20
5.2.130.0100.03711.02
5.2.120.0170.02711.03
5.2.110.0030.03711.02
5.2.100.0130.02711.05
5.2.90.0130.02311.24
5.2.80.0100.03011.06
5.2.70.0130.03311.08
5.2.60.0100.02711.02
5.2.50.0130.02311.14
5.2.40.0030.03011.02
5.2.30.0100.02310.96
5.2.20.0000.03311.00
5.2.10.0030.04011.00
5.2.00.0070.03710.76
5.1.60.0170.0279.91
5.1.50.0030.0309.95
5.1.40.0070.03310.04
5.1.30.0070.02710.35
5.1.20.0100.02310.29
5.1.10.0030.02710.20
5.1.00.0030.02710.08
5.0.50.0030.0208.47
5.0.40.0070.0178.48
5.0.30.0070.0378.36
5.0.20.0000.0238.33
5.0.10.0070.0178.32
5.0.00.0000.0338.14
4.4.90.0000.0175.92
4.4.80.0000.0175.85
4.4.70.0030.0175.89
4.4.60.0000.0205.81
4.4.50.0000.0205.91
4.4.40.0030.0305.80
4.4.30.0030.0205.82
4.4.20.0000.0235.92
4.4.10.0000.0236.01
4.4.00.0030.0275.98
4.3.110.0070.0135.83
4.3.100.0000.0175.74
4.3.90.0000.0175.75
4.3.80.0030.0235.75
4.3.70.0000.0235.71
4.3.60.0000.0175.91
4.3.50.0030.0135.76
4.3.40.0030.0275.73
4.3.30.0000.0174.67
4.3.20.0000.0234.53
4.3.10.0030.0174.48
4.3.00.0030.02010.29

preferences:
146.63 ms | 1394 KiB | 7 Q