3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parseHeaders( $header ) { $retVal = array(); $fields = explode("\r\n", preg_replace('/\x0D\x0A[\x09\x20]+/', ' ', $header)); foreach( $fields as $field ) { if( preg_match('/([^:]+): (.+)/m', $field, $match) ) { $match[1] = preg_replace('/(?<=^|[\x09\x20\x2D])./e', 'strtoupper("\0")', strtolower(trim($match[1]))); if( isset($retVal[$match[1]]) ) { if (!is_array($retVal[$match[1]])) { $retVal[$match[1]] = array($retVal[$match[1]]); } $retVal[$match[1]][] = $match[2]; } else { $retVal[$match[1]] = trim($match[2]); } } } return $retVal; } $headers = "HTTP/1.1 200 OK\r\n". "content-type: text/html; charset=UTF-8\r\n". "Server: Funky/1.0\r\n". "Set-Cookie: foo=bar\r\n". "Set-Cookie: baz=quux\r\n". "Folded: works\r\n\ttoo\r\n"; print_r(parseHeaders($headers));

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.0070.01417.00
8.3.50.0150.00416.64
8.3.40.0090.00619.07
8.3.30.0040.01119.07
8.3.20.0040.00420.34
8.3.10.0050.00321.76
8.3.00.0040.00423.36
8.2.180.0180.00418.79
8.2.170.0110.01122.96
8.2.160.0100.00320.38
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0030.00521.04
8.2.120.0070.00026.35
8.2.110.0090.00019.27
8.2.100.0060.00618.05
8.2.90.0050.00319.17
8.2.80.0000.00818.00
8.2.70.0030.00617.88
8.2.60.0000.00818.05
8.2.50.0060.00318.09
8.2.40.0040.00422.45
8.2.30.0040.00419.65
8.2.20.0030.00518.04
8.2.10.0030.00518.13
8.2.00.0040.00418.25
8.1.280.0090.00625.92
8.1.270.0120.00622.20
8.1.260.0070.00028.09
8.1.250.0040.00428.09
8.1.240.0000.00822.73
8.1.230.0040.00717.83
8.1.220.0050.00317.79
8.1.210.0040.00418.77
8.1.200.0090.00017.60
8.1.190.0060.00317.50
8.1.180.0030.00518.10
8.1.170.0040.00418.71
8.1.160.0040.00420.81
8.1.150.0000.00818.98
8.1.140.0030.00519.67
8.1.130.0030.00317.70
8.1.120.0040.00417.59
8.1.110.0040.00417.49
8.1.100.0000.00717.61
8.1.90.0050.00217.63
8.1.80.0000.00817.63
8.1.70.0000.00817.61
8.1.60.0040.00417.65
8.1.50.0000.00817.63
8.1.40.0030.00517.66
8.1.30.0060.00317.67
8.1.20.0080.00017.80
8.1.10.0000.00817.63
8.1.00.0030.00617.66
8.0.300.0000.00818.96
8.0.290.0000.00816.88
8.0.280.0040.00418.41
8.0.270.0000.00717.29
8.0.260.0030.00317.27
8.0.250.0000.00717.16
8.0.240.0000.00817.16
8.0.230.0070.00017.16
8.0.220.0030.00517.10
8.0.210.0040.00417.10
8.0.200.0060.00017.16
8.0.190.0060.00317.16
8.0.180.0000.01117.04
8.0.170.0050.00317.06
8.0.160.0000.00717.02
8.0.150.0000.00817.02
8.0.140.0040.00416.98
8.0.130.0000.00813.60
8.0.120.0040.00417.18
8.0.110.0040.00417.16
8.0.100.0000.00717.04
8.0.90.0040.00417.19
8.0.80.0040.01517.13
8.0.70.0000.00717.26
8.0.60.0020.00517.15
8.0.50.0000.00717.06
8.0.30.0100.00817.31
8.0.20.0150.00617.43
8.0.10.0000.00717.25
8.0.00.0090.00816.87
7.4.330.0000.00516.86
7.4.320.0000.00716.88
7.4.300.0040.00516.88
7.4.290.0050.00216.69
7.4.280.0000.00816.82
7.4.270.0000.00816.91
7.4.260.0000.00716.86
7.4.250.0040.00416.77
7.4.240.0040.00416.79
7.4.230.0000.00716.90
7.4.220.0110.00716.71
7.4.210.0080.00716.78
7.4.200.0000.00716.79
7.4.160.0070.01016.72
7.4.150.0130.00417.40
7.4.140.0120.01117.86
7.4.130.0140.00816.87
7.4.120.0100.00716.76
7.4.110.0000.01916.76
7.4.100.0190.00416.83
7.4.90.0090.00916.81
7.4.80.0120.00919.39
7.4.70.0080.00816.91
7.4.60.0080.01116.82
7.4.50.0070.00416.50
7.4.40.0070.01116.82
7.4.30.0090.00916.79
7.4.10.0090.00615.30
7.4.00.0100.00515.04
7.3.330.0070.00013.59
7.3.320.0050.00013.60
7.3.310.0030.00316.48
7.3.300.0030.00316.61
7.3.290.0000.00716.54
7.3.280.0080.01116.63
7.3.270.0030.01317.40
7.3.260.0120.00616.85
7.3.250.0070.01016.72
7.3.240.0110.00716.62
7.3.230.0110.00716.61
7.3.210.0120.00916.57
7.3.200.0180.00319.39
7.3.190.0160.00016.71
7.3.180.0080.00916.90
7.3.170.0100.00716.60
7.3.160.0060.01516.86
7.3.130.0100.01015.25
7.3.120.0070.01114.89
7.3.110.0100.01015.11
7.3.100.0060.00915.29
7.3.90.0030.01714.81
7.3.80.0070.00314.74
7.3.70.0100.00315.20
7.3.60.0120.00015.09
7.3.50.0100.00715.04
7.3.40.0150.00015.16
7.3.30.0040.01214.90
7.3.20.0090.00616.75
7.3.10.0100.00616.80
7.3.00.0020.01016.96
7.2.330.0070.01116.92
7.2.320.0070.01016.86
7.2.310.0080.00816.91
7.2.300.0240.00016.89
7.2.290.0090.00916.90
7.2.260.0080.00915.48
7.2.250.0060.01215.25
7.2.240.0090.00615.37
7.2.230.0080.00815.48
7.2.220.0060.00615.52
7.2.210.0030.01015.32
7.2.200.0110.00315.17
7.2.190.0060.00915.23
7.2.180.0060.01215.18
7.2.170.0030.00615.04
7.2.160.0030.01315.18
7.2.150.0040.01117.07
7.2.140.0030.01017.13
7.2.130.0060.00917.07
7.2.120.0090.00616.98
7.2.110.0110.00317.04
7.2.100.0070.00617.19
7.2.90.0080.00517.12
7.2.80.0060.00817.10
7.2.70.0040.00916.98
7.2.60.0100.00617.07
7.2.50.0070.01017.20
7.2.40.0080.00717.21
7.2.30.0020.00817.06
7.2.20.0050.00916.96
7.2.10.0090.00417.04
7.2.00.0040.01017.97
7.1.330.0090.00016.01
7.1.320.0030.01016.16
7.1.310.0000.01416.04
7.1.300.0070.00715.81
7.1.290.0070.01016.04
7.1.280.0060.00616.11
7.1.270.0060.00915.90
7.1.260.0040.01115.84
7.1.250.0040.00815.97
7.1.240.0030.01015.95
7.1.230.0090.00616.11
7.1.220.0030.01015.95
7.1.210.0070.00715.82
7.1.200.0020.01015.84
7.1.190.0070.00715.98
7.1.180.0060.01015.98
7.1.170.0030.01016.10
7.1.160.0060.00316.07
7.1.150.0030.01416.02
7.1.140.0030.00715.84
7.1.130.0030.01016.13
7.1.120.0000.01316.02
7.1.110.0060.00316.18
7.1.100.0060.01017.26
7.1.90.0070.00716.07
7.1.80.0070.00715.88
7.1.70.0050.00816.66
7.1.60.0090.00617.58
7.1.50.0070.01016.65
7.1.40.0060.00316.11
7.1.30.0080.00015.81
7.1.20.0060.00916.04
7.1.10.0040.01116.13
7.1.00.0070.04019.27
7.0.330.0030.01015.45
7.0.320.0030.00715.44
7.0.310.0030.00615.61
7.0.300.0040.01115.55
7.0.290.0040.00715.53
7.0.280.0030.00615.62
7.0.270.0030.00615.28
7.0.260.0100.00315.52
7.0.250.0070.00715.72
7.0.240.0060.00915.62
7.0.230.0100.00615.64
7.0.220.0080.00815.61
7.0.210.0070.00715.74
7.0.200.0290.00515.30
7.0.190.0030.01015.30
7.0.180.0030.01215.62
7.0.170.0030.00615.56
7.0.160.0080.00815.79
7.0.150.0040.01115.63
7.0.140.0100.00315.69
7.0.130.0060.00915.67
7.0.120.0030.01015.48
7.0.110.0040.01115.79
7.0.100.0040.00415.67
7.0.90.0030.01015.61
7.0.80.0060.00615.67
7.0.70.0000.01115.73
7.0.60.0160.04418.61
7.0.50.0020.02516.81
7.0.40.0060.04616.91
7.0.30.0320.02817.04
7.0.20.0190.02916.92
7.0.10.0070.04816.88
7.0.00.0140.02016.86
5.6.400.0060.00314.22
5.6.390.0030.01014.44
5.6.380.0000.01014.60
5.6.370.0040.00814.58
5.6.360.0000.01314.19
5.6.350.0040.01114.43
5.6.340.0100.00314.17
5.6.330.0040.01114.79
5.6.320.0060.00614.84
5.6.310.0040.01114.47
5.6.300.0050.00514.84
5.6.290.0040.01214.23
5.6.280.0030.02617.64
5.6.270.0000.01514.61
5.6.260.0030.01414.31
5.6.250.0040.00414.73
5.6.240.0060.00614.43
5.6.230.0100.00314.58
5.6.220.0030.01014.78
5.6.210.0060.04617.75
5.6.200.0090.01816.35
5.6.190.0080.04117.43
5.6.180.0040.04917.63
5.6.170.0160.03517.66
5.6.160.0070.02817.59
5.6.150.0020.02516.23
5.6.140.0080.03016.42
5.6.130.0070.02316.37
5.6.120.0090.02117.75
5.6.110.0110.04117.66
5.6.100.0130.04217.56
5.6.90.0020.03017.81
5.6.80.0080.04017.44
5.6.70.0080.00814.40
5.6.60.0060.00614.57
5.6.50.0120.00314.11
5.6.40.0060.00914.36
5.6.30.0150.00414.43
5.6.20.0090.00614.71
5.6.10.0070.00714.58
5.6.00.0000.01314.52
5.5.380.0030.01314.84
5.5.370.0060.00314.61
5.5.360.0060.00914.58
5.5.350.0160.03817.43
5.5.340.0080.02616.31
5.5.330.0000.04817.49
5.5.320.0340.01817.22
5.5.310.0200.04517.54
5.5.300.0070.04416.22
5.5.290.0070.03416.15
5.5.280.0070.02417.66
5.5.270.0050.02517.85
5.5.260.0090.04217.80
5.5.250.0050.04917.55
5.5.240.1570.02417.33
5.5.230.0100.00714.46
5.5.220.0070.01014.23
5.5.210.0090.00614.61
5.5.200.0040.01114.51
5.5.190.0060.00914.62
5.5.180.0000.01014.56
5.5.170.0040.01214.59
5.5.160.0070.00714.40
5.5.150.0070.00314.49
5.5.140.0040.01114.44
5.5.130.0030.01014.65
5.5.120.0090.00614.35
5.5.110.0000.01514.20
5.5.100.0000.01314.51
5.5.90.0090.00614.37
5.5.80.0060.00914.52
5.5.70.0000.01714.70
5.5.60.0130.00314.29
5.5.50.0070.00714.64
5.5.40.0060.00314.47
5.5.30.0030.00814.68
5.5.20.0090.00614.47
5.5.10.0070.00714.15
5.5.00.0000.01314.47

preferences:
68.16 ms | 400 KiB | 5 Q