3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parseQueryString($str) { $result = []; foreach (explode('&', $str) as $element) { $parts = explode('=', $element, 2); $key = urldecode(array_shift($parts)); $value = $parts ? urldecode(array_shift($parts)) : ''; if (false !== $pos = strpos($key, '[')) { $base = substr($key, 0, $pos++); $result[$base] = []; $target = &$result[$base]; do { $end = strpos($key, ']', $pos); $index = substr($key, $pos, $end - $pos); $target[$index] = []; $target = &$target[$index]; $pos = $end; } while($pos < strlen($key)); var_dump($result); } } } $str = 'foo=bar&baz[foo]=qux&baz[foo][goat]=chick'; parseQueryString($str);

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.0470.03080.71
8.3.50.0850.04380.24
8.3.40.0410.01746.47
8.3.30.0310.02047.91
8.3.20.0190.01047.82
8.3.10.0100.01048.36
8.3.00.0070.01448.82
8.2.180.1030.03780.38
8.2.170.0480.03448.33
8.2.160.0370.02450.13
8.2.150.0100.02048.53
8.2.140.0280.01948.39
8.2.130.0120.01250.54
8.2.120.0120.01247.77
8.2.110.0240.01450.12
8.2.100.0320.01947.34
8.2.90.0260.00448.77
8.2.80.0200.00749.00
8.2.70.0230.01047.25
8.2.60.0250.00747.43
8.2.50.0070.02847.25
8.2.40.0210.01147.72
8.2.30.0040.02847.81
8.2.20.0090.01947.26
8.2.10.0260.00647.39
8.2.00.0170.01747.25
8.1.280.0640.04480.15
8.1.270.0280.00351.80
8.1.260.0260.00651.58
8.1.250.0130.01652.03
8.1.240.0160.01652.24
8.1.230.0290.01347.14
8.1.220.0130.01747.39
8.1.210.0150.01546.98
8.1.200.0190.01346.97
8.1.190.0070.02447.41
8.1.180.0170.01349.79
8.1.170.0350.00348.25
8.1.160.0240.00751.75
8.1.150.0180.01448.27
8.1.140.0070.02347.16
8.1.130.0130.01747.43
8.1.120.0190.01347.09
8.1.110.0150.01247.04
8.1.100.0270.00347.07
8.1.90.0130.01647.21
8.1.80.0130.01647.07
8.1.70.0100.01747.05
8.1.60.0100.02247.33
8.1.50.0110.01847.28
8.1.40.0180.01447.21
8.1.30.0100.02047.34
8.1.20.0070.02447.38
8.1.10.0330.02081.37
8.1.00.0300.03481.14
8.0.300.0260.02680.91
8.0.290.0230.03080.79
8.0.280.0270.03881.90
8.0.270.0200.03980.83
8.0.260.0210.03580.36
8.0.250.0230.03380.38
8.0.240.0450.01980.36
8.0.230.0160.03680.37
8.0.220.0330.03080.41
8.0.210.0170.03780.44
8.0.200.0260.03680.36
8.0.190.0270.03480.48
8.0.180.0340.02780.44
8.0.170.0160.04680.45
8.0.160.0380.01780.52
8.0.150.0310.02780.36
8.0.140.0270.03380.46
8.0.130.0540.050136.89
8.0.120.0410.01680.48
8.0.110.0200.03680.47
8.0.100.0170.04180.41
8.0.90.0210.03180.41
8.0.80.0600.06580.41
8.0.70.0230.03080.45
8.0.60.0130.04080.35
8.0.50.0300.02780.38
8.0.30.0750.09780.51
8.0.20.0730.06680.68
8.0.10.0300.02380.34
8.0.00.0600.08780.26
7.4.330.0330.02376.86
7.4.320.0270.02780.07
7.4.300.0100.04880.09
7.4.290.0290.02980.05
7.4.280.0230.03380.09
7.4.270.0270.02780.04
7.4.260.0330.02680.05
7.4.250.0190.03679.97
7.4.240.0250.03079.98
7.4.230.0160.03979.80
7.4.220.0890.08980.02
7.4.210.0470.07680.11
7.4.200.0210.03179.92
7.4.190.0370.01780.10
7.4.160.0560.06979.89
7.4.150.0710.06480.27
7.4.140.0790.08780.00
7.4.130.0810.09180.04
7.4.120.0640.07080.02
7.4.110.0490.08980.16
7.4.100.0400.10680.12
7.4.90.0790.06979.94
7.4.80.0670.09480.07
7.4.70.0850.07179.80
7.4.60.0580.07780.04
7.4.50.0230.03679.91
7.4.40.0370.05479.96
7.4.30.0740.06280.22
7.4.00.0300.07978.29
7.3.330.0330.062137.11
7.3.320.0680.039137.25
7.3.310.0350.02179.92
7.3.300.0170.03779.90
7.3.290.0580.07979.91
7.3.280.0480.08279.86
7.3.270.0630.07680.08
7.3.260.0660.06380.10
7.3.250.0840.08880.05
7.3.240.0580.08880.00
7.3.230.0530.08079.81
7.3.210.0720.09180.15
7.3.200.0640.09480.11
7.3.190.0930.10079.91
7.3.180.0570.08379.85
7.3.170.0710.06879.88
7.3.160.0500.08479.87
7.3.120.0330.08378.68
7.3.110.0500.09378.36
7.3.100.0370.06178.38
7.3.90.0330.10378.57
7.3.80.0360.06678.26
7.3.70.0300.06878.27
7.3.60.0380.06678.57
7.3.50.0230.07978.26
7.3.40.0350.07078.25
7.3.30.0510.05478.23
7.3.20.0430.05878.67
7.3.10.0410.05578.79
7.3.00.0320.05878.62
7.2.330.0780.08480.25
7.2.320.0780.06880.38
7.2.310.0720.06280.45
7.2.300.0600.12380.50
7.2.290.0770.06480.52
7.2.250.0480.09978.91
7.2.240.0560.09278.64
7.2.230.0500.07778.88
7.2.220.0430.09678.71
7.2.210.0380.06578.66
7.2.200.0310.07178.70
7.2.190.0400.06478.70
7.2.180.0440.05478.71
7.2.170.0490.06578.65
7.2.60.1000.04579.38
7.2.00.2110.05981.75
7.1.330.0330.07978.14
7.1.320.0330.08778.07
7.1.310.0350.08677.97
7.1.300.0510.07277.81
7.1.290.0460.06377.80
7.1.280.0420.09078.02
7.1.270.0360.06877.88
7.1.260.0270.08378.17
7.1.200.1930.03278.20
7.1.100.2080.05880.37
7.1.70.0160.02579.30
7.1.60.0140.07879.51
7.1.50.0490.07879.21
7.1.00.0100.08084.57
7.0.200.5240.06378.27
7.0.140.0170.11384.42
7.0.60.0230.13383.77
7.0.50.0300.12781.54
7.0.40.0130.10320.24
7.0.30.0370.11720.25
7.0.20.0200.07320.31
7.0.10.0300.10720.18
7.0.00.0170.13320.16
5.6.280.0100.24786.07
5.6.210.0330.19085.46
5.6.200.0200.19783.07
5.6.190.0270.17785.33
5.6.180.0570.20385.28
5.6.170.0500.15085.39
5.6.160.0170.16785.32
5.6.150.0270.16383.07
5.6.140.0270.14383.20
5.6.130.0130.18083.15
5.6.120.0300.22086.09
5.6.110.0300.23085.96
5.6.100.0370.21385.99
5.6.90.0300.20386.10
5.6.80.0270.19385.34
5.6.70.0570.21085.35
5.5.350.0300.16085.31
5.5.340.0270.21382.93
5.5.330.0300.16785.17
5.5.320.0670.19785.18
5.5.310.0570.24785.21
5.5.300.0300.14782.91
5.5.290.0300.17782.93
5.5.280.0430.20785.62
5.5.270.0330.20785.86
5.5.260.0470.19785.85
5.5.250.0230.22785.54
5.5.240.0170.15785.25
5.4.450.1130.27784.23
5.4.440.0970.28084.12
5.4.430.0370.27384.19
5.4.420.0600.26384.27
5.4.410.0530.27384.41
5.4.400.1370.45383.91
5.4.390.1130.36083.58
5.4.380.0670.30783.80
5.4.370.0600.25783.54
5.4.360.0570.26383.63
5.4.350.0320.21077.10
5.4.340.0280.20977.10
5.4.320.0290.19177.59
5.4.310.0270.20077.58
5.4.300.0240.19477.59
5.4.290.0310.19877.58
5.4.280.0190.19777.48
5.4.270.0230.19477.48
5.4.260.0280.19577.48
5.4.250.0570.26383.88
5.4.240.0470.27783.86
5.4.230.0400.35783.67
5.4.220.0430.31083.85
5.4.210.0600.29083.82
5.4.200.0430.27383.84
5.4.190.0700.33383.82
5.4.180.0570.29783.77
5.4.170.0530.24383.52
5.4.160.0500.27083.81
5.4.150.0570.26383.81
5.4.140.0500.26081.25
5.4.130.0330.29081.20
5.4.120.0470.26781.41
5.4.110.0430.28381.53
5.4.100.0400.27781.41
5.4.90.0230.35781.44
5.4.80.0370.27081.34
5.4.70.0370.24381.30
5.4.60.0430.28781.29
5.4.50.0430.26781.45
5.4.40.0400.24381.31
5.4.30.0400.24081.24
5.4.20.0670.24081.50
5.4.10.0330.28781.30
5.4.00.0230.28380.88
5.3.290.0040.04112.80
5.3.280.0070.07314.69
5.3.270.0030.05714.69
5.3.260.0100.05314.58
5.3.250.0000.05714.59
5.3.240.0070.05014.68
5.3.230.0130.06714.59
5.3.220.0130.04714.70
5.3.210.0100.06014.63
5.3.200.0130.04314.59
5.3.190.0130.04014.75
5.3.180.0070.05014.72
5.3.170.0100.04714.73
5.3.160.0030.05014.47
5.3.150.0070.05014.53
5.3.140.0070.05014.62
5.3.130.0030.05714.72
5.3.120.0030.05714.63
5.3.110.0030.07714.63
5.3.100.0070.05014.21
5.3.90.0070.05014.11
5.3.80.0200.04714.03
5.3.70.0030.05314.00
5.3.60.0130.06013.99
5.3.50.0000.05713.93
5.3.40.0070.05714.03
5.3.30.0070.04713.98
5.3.20.0100.04713.75
5.3.10.0070.07013.63
5.3.00.0070.07313.46
5.2.170.0030.04311.21
5.2.160.0000.04311.31
5.2.150.0070.04011.12
5.2.140.0070.04011.13
5.2.130.0030.04311.17
5.2.120.0100.04011.15
5.2.110.0100.04711.17
5.2.100.0100.04310.93
5.2.90.0100.03711.09
5.2.80.0030.04311.17
5.2.70.0100.04011.06
5.2.60.0030.04311.12
5.2.50.0030.04311.10
5.2.40.0070.03711.00
5.2.30.0070.03711.05
5.2.20.0070.03710.86
5.2.10.0170.03010.93
5.2.00.0030.04010.55
5.1.60.0100.0279.96
5.1.50.0030.03310.00
5.1.40.0030.03310.02
5.1.30.0030.03710.40
5.1.20.0100.03010.57
5.1.10.0100.03010.04
5.1.00.0130.04310.30
5.0.50.0100.0308.55
5.0.40.0070.0338.50
5.0.30.0100.0378.05
5.0.20.0030.0278.11
5.0.10.0100.0238.18
5.0.00.0000.0438.20
4.4.90.0030.0206.20
4.4.80.0000.0236.20
4.4.70.0000.0236.19
4.4.60.0000.0236.19
4.4.50.0030.0206.19
4.4.40.0000.0406.19
4.4.30.0030.0206.19
4.4.20.0000.0236.19
4.4.10.0000.0236.19
4.4.00.0000.0506.19
4.3.110.0000.0236.19
4.3.100.0000.0236.19
4.3.90.0070.0176.19
4.3.80.0000.0336.19
4.3.70.0070.0176.19
4.3.60.0030.0206.19
4.3.50.0070.0236.19
4.3.40.0070.0276.19
4.3.30.0000.0236.19
4.3.20.0030.0236.19
4.3.10.0000.0276.19
4.3.00.0170.0176.97

preferences:
44.16 ms | 401 KiB | 5 Q