3v4l.org

run code in 300+ PHP versions simultaneously
<?php <?php function parseHeaders($headers) { $headers = preg_split("/(\r|\n)+/", $headers, -1, PREG_SPLIT_NO_EMPTY); $parse_headers = array(); for ($i = 1; $i < count($headers); $i++) { list($key, $raw_value) = explode(':', $headers[$i], 2); $key = trim($key); $value = trim($raw_value); if (array_key_exists($key, $parse_headers)) { // See HTTP RFC Sec 4.2 Paragraph 5 // http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 // If a header appears more than once, it must also be able to // be represented as a single header with a comma-separated // list of values. We transform accordingly. $parse_headers[$key] .= ',' . $value; } else { $parse_headers[$key] = $value; } } return $parse_headers; } print_r(parseHeaders('HTTP/1.1 200 OK x-amz-id-2: VY3SprXJgsllfuyxECb2ykYo74ZQO/V+cbGadSo/FFt1VysYO+f66gb18XM9h0LOnl4wei6XSdc= x-amz-request-id: 00B4612940F92DAF Date: Tue, 05 Jan 2016 20:50:25 GMT ETag: "9d3213e68a63ed25415b44031ccf6a37" Content-Length: 0 Server: AmazonS3'));

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.0.10.0100.05020.08
7.0.00.0070.08720.15
5.6.160.0030.08720.62
5.6.150.0100.07018.16
5.6.140.0070.08018.14
5.6.130.0070.07718.19
5.6.120.0100.04320.97
5.6.110.0100.08021.01
5.6.100.0100.07020.95
5.6.90.0170.07720.92
5.6.80.0070.05320.39
5.5.300.0030.06017.98
5.5.290.0030.06017.95
5.5.280.0030.05720.73
5.5.270.0130.07720.76
5.5.260.0100.08720.86
5.5.250.0070.07020.70
5.5.240.0230.08020.18
5.4.450.0630.05719.27
5.4.440.0530.05719.26
5.4.430.0930.05319.60
5.4.420.0770.05019.25
5.4.410.0630.05019.38
5.4.400.0830.04019.11
5.4.390.0730.05719.22
5.4.380.0630.05019.22
5.4.370.0670.04318.95
5.4.360.0670.04719.19
5.4.350.0630.05019.32
5.4.340.0630.05319.23
5.4.320.0600.05319.32
5.4.310.0600.05318.93
5.4.300.0570.05719.19
5.4.290.0830.04719.24
5.4.280.0800.04719.18
5.4.270.0570.05719.22
5.4.260.0530.06019.09
5.4.250.0730.05719.11
5.4.240.0770.05019.26
5.4.230.0830.07019.16
5.4.220.0730.05719.11
5.4.210.0930.06719.20
5.4.200.0770.07019.16
5.4.190.0730.05319.31
5.4.180.0630.06019.18
5.4.170.0630.06019.06
5.4.160.0600.05319.25
5.4.150.0630.06318.90
5.4.140.0630.05016.50
5.4.130.0770.05016.18
5.4.120.0770.04716.49
5.4.110.0770.05316.54
5.4.100.0600.05316.61
5.4.90.0600.05016.57
5.4.80.0600.04716.50
5.4.70.0570.05716.60
5.4.60.0600.05016.20
5.4.50.0670.04316.55
5.4.40.0600.05016.48
5.4.30.0570.05016.59
5.4.20.0570.05316.22
5.4.10.0830.04016.47
5.4.00.0770.04316.00
5.3.290.0870.06014.54
5.3.280.0770.05714.48
5.3.270.0670.06014.50
5.3.260.0570.06014.59
5.3.250.0770.04714.53
5.3.240.0870.06014.62
5.3.230.0870.05314.52
5.3.220.0630.05014.47
5.3.210.0600.05314.49
5.3.200.0800.04314.66
5.3.190.0770.04014.50
5.3.180.0630.06014.45
5.3.170.0730.03314.46
5.3.160.0670.05714.52
5.3.150.0570.05714.49
5.3.140.0670.04314.35
5.3.130.0670.04714.43
5.3.120.0630.05014.45
5.3.110.0670.04714.45
5.3.100.0730.04713.96
5.3.90.0600.05714.00
5.3.80.0600.05314.05
5.3.70.0730.04713.95
5.3.60.0830.04013.93
5.3.50.0730.04713.88
5.3.40.0800.04014.04
5.3.30.0530.04313.73
5.3.20.0070.05013.62
5.3.10.0170.04713.68
5.3.00.0130.05013.56
5.2.170.0470.04710.98
5.2.160.0530.03711.04
5.2.150.0430.04311.07
5.2.140.0130.03711.22
5.2.130.0500.04011.00
5.2.120.0100.04310.96
5.2.110.0100.04011.03
5.2.100.0230.04011.09
5.2.90.0200.04011.04
5.2.80.0170.03711.05
5.2.70.0170.04010.99
5.2.60.0130.04010.95
5.2.50.0100.04310.89
5.2.40.0030.04310.97
5.2.30.0200.03710.87
5.2.20.0200.03010.89
5.2.10.0100.04010.85
5.2.00.0030.04710.76
5.1.60.0100.0379.90
5.1.50.0130.0339.99
5.1.40.0070.0379.98
5.1.30.0100.04310.34
5.1.20.0130.03710.34
5.1.10.0230.02310.22
5.1.00.0100.03710.07
5.0.50.0130.0238.52
5.0.40.0030.0308.55
5.0.30.0030.0438.12
5.0.20.0070.0238.20
5.0.10.0070.0238.23
5.0.00.0070.0408.12
4.4.90.0030.0236.61
4.4.80.0170.0136.61
4.4.70.0170.0176.62
4.4.60.0100.0176.62
4.4.50.0070.0206.62
4.4.40.0070.0336.62
4.4.30.0030.0236.62
4.4.20.0030.0236.62
4.4.10.0070.0206.62
4.4.00.0030.0376.62
4.3.110.0100.0176.62
4.3.100.0000.0236.62
4.3.90.0030.0206.62
4.3.80.0100.0306.62
4.3.70.0000.0236.62
4.3.60.0070.0176.62
4.3.50.0070.0176.62
4.3.40.0070.0306.62
4.3.30.0070.0206.62
4.3.20.0030.0276.62
4.3.10.0000.0236.62
4.3.00.0030.0206.62

preferences:
140.81 ms | 1394 KiB | 7 Q