3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '[ ["key1", "value1"], ["key2", "value2"], ["key3", "value3"] ]'; preg_match_all('/(\[("(.*?)"), ("(.*?)")\])/i', $str, $matches); //Now we have in $matches[3] and $matches[5] the keys and the values //and we would now turn this into an array using a loop $new_array = array(); for($k = 0; $k < count($matches[3]); $k++) { $new_array[$matches[3][$k]] = $matches[5][$k]; } var_dump($new_array);

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.4.120.0070.00124.17
8.4.110.0110.00918.80
8.4.100.0160.00517.91
8.4.90.0110.01018.10
8.4.80.0020.00617.91
8.4.70.0120.00917.88
8.4.60.0110.00918.50
8.4.50.0180.00618.84
8.4.40.0080.00820.79
8.4.30.0190.00317.72
8.4.20.0120.00817.78
8.4.10.0040.00417.63
8.3.250.0100.00918.98
8.3.240.0110.00916.88
8.3.230.0130.00716.55
8.3.220.0140.00516.79
8.3.210.0120.00916.97
8.3.200.0040.00516.79
8.3.190.0030.00617.17
8.3.180.0070.00617.15
8.3.170.0120.00618.97
8.3.160.0110.00716.67
8.3.150.0070.01317.23
8.3.140.0090.00916.76
8.3.130.0080.00016.98
8.3.120.0040.00418.71
8.3.110.0000.00816.84
8.3.100.0030.00616.88
8.3.90.0070.01318.45
8.3.80.0070.00318.68
8.3.70.0090.00916.63
8.3.60.0130.01016.72
8.3.50.0110.00621.15
8.3.40.0110.00419.00
8.3.30.0090.00618.97
8.3.20.0040.00418.85
8.3.10.0060.00321.59
8.3.00.0080.00020.77
8.2.290.0090.00920.79
8.2.280.0110.01018.62
8.2.270.0090.00917.17
8.2.260.0090.00620.77
8.2.250.0030.00518.50
8.2.240.0030.01219.08
8.2.230.0040.00420.94
8.2.220.0060.00337.54
8.2.210.0050.00326.77
8.2.200.0090.00016.88
8.2.190.0120.00617.00
8.2.180.0140.00716.75
8.2.170.0110.00722.96
8.2.160.0140.00020.44
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0110.00426.16
8.2.120.0040.00419.69
8.2.110.0040.00422.32
8.2.100.0090.00317.97
8.2.90.0040.00419.20
8.2.80.0030.00717.97
8.2.70.0030.00617.88
8.2.60.0040.00417.80
8.2.50.0030.00618.07
8.2.40.0000.01018.10
8.2.30.0000.00718.23
8.2.20.0000.00817.97
8.2.10.0040.00418.21
8.2.00.0040.00418.16
8.1.330.0120.00716.49
8.1.320.0100.01016.45
8.1.310.0130.00316.76
8.1.300.0040.00420.40
8.1.290.0050.00518.88
8.1.280.0080.00825.92
8.1.270.0080.00023.99
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0090.00322.19
8.1.230.0120.00022.16
8.1.220.0030.00617.76
8.1.210.0000.00818.77
8.1.200.0100.00017.48
8.1.190.0040.00417.35
8.1.180.0060.00318.10
8.1.170.0080.00018.55
8.1.160.0000.00818.93
8.1.150.0070.00018.94
8.1.140.0040.00419.67
8.1.130.0040.00417.73
8.1.120.0000.00717.65
8.1.110.0030.00517.59
8.1.100.0000.00717.53
8.1.90.0040.00417.64
8.1.80.0030.00517.68
8.1.70.0000.00717.47
8.1.60.0040.00417.79
8.1.50.0000.00817.63
8.1.40.0000.00817.70
8.1.30.0040.00417.84
8.1.20.0060.00317.84
8.1.10.0070.00017.60
8.1.00.0000.00817.57
8.0.300.0040.00420.02
8.0.290.0000.01116.75
8.0.280.0030.00318.43
8.0.270.0050.00316.84
8.0.260.0030.00317.16
8.0.250.0030.00316.96
8.0.240.0000.00617.01
8.0.230.0000.00716.96
8.0.220.0040.00417.00
8.0.210.0000.00717.00
8.0.200.0030.00317.06
8.0.190.0000.00817.02
8.0.180.0040.00417.03
8.0.170.0000.00717.13
8.0.160.0070.00017.04
8.0.150.0000.00717.01
8.0.140.0050.00217.06
8.0.130.0000.00513.44
8.0.120.0030.00517.02
8.0.110.0040.00417.10
8.0.100.0000.00717.09
8.0.90.0040.00416.95
8.0.80.0100.00617.11
8.0.70.0040.00417.11
8.0.60.0000.00816.93
8.0.50.0000.00716.94
8.0.30.0110.00717.31
8.0.20.0060.01317.41
8.0.10.0030.00517.00
8.0.00.0120.00717.03
7.4.330.0000.00515.08
7.4.320.0000.00616.79
7.4.300.0040.00416.78
7.4.290.0030.00316.62
7.4.280.0040.00416.70
7.4.270.0030.00316.84
7.4.260.0030.00716.64
7.4.250.0050.00216.80
7.4.240.0080.00016.73
7.4.230.0030.00316.61
7.4.220.0150.01216.80
7.4.210.0080.00616.68
7.4.200.0030.00316.81
7.4.160.0060.00916.79
7.4.150.0120.00617.40
7.4.140.0130.00817.86
7.4.130.0090.00816.57
7.4.120.0140.00516.78
7.4.110.0000.01816.63
7.4.100.0070.01316.77
7.4.90.0070.01116.64
7.4.80.0150.00819.39
7.4.70.0080.00916.68
7.4.60.0070.01016.71
7.4.50.0090.00616.73
7.4.40.0090.00616.77
7.4.30.0110.00616.59
7.4.00.0040.00815.11
7.3.330.0050.00013.31
7.3.320.0050.00013.34
7.3.310.0030.00316.57
7.3.300.0040.00416.33
7.3.290.0100.00916.51
7.3.280.0050.01216.49
7.3.270.0160.00417.40
7.3.260.0070.01016.58
7.3.250.0140.01016.73
7.3.240.0060.01116.52
7.3.230.0120.00616.69
7.3.210.0150.00316.53
7.3.200.0110.00616.48
7.3.190.0160.00316.76
7.3.180.0150.01016.71
7.3.170.0100.00816.57
7.3.160.0110.00816.52
7.3.10.0030.00816.74
7.3.00.0080.00816.89
7.2.330.0120.00616.78
7.2.320.0110.00716.84
7.2.310.0100.00716.65
7.2.300.0080.00816.71
7.2.290.0160.00016.88
7.2.130.0160.01017.11
7.2.120.0060.01516.74
7.2.110.0030.01017.20
7.2.100.0070.00717.18
7.2.90.0070.00717.13
7.2.80.0070.01016.96
7.2.70.0040.01116.85
7.2.60.0030.01016.90
7.2.50.0000.01017.27
7.2.40.0040.00817.14
7.2.30.0000.00916.97
7.2.20.0030.00916.98
7.2.10.0000.01316.94
7.2.00.0020.01717.98
7.1.250.0050.01016.13
7.1.200.0030.00916.06
7.1.100.0060.00618.49
7.1.70.0030.00517.29
7.1.60.0110.01420.41
7.1.00.0030.07722.44
7.0.200.0300.00314.73
7.0.60.0200.08319.85
7.0.50.0070.03717.91
7.0.40.0600.07020.04
7.0.30.0470.06320.05
7.0.20.0600.06020.22
7.0.10.0570.07320.34
7.0.00.0470.06720.34
5.6.280.0030.07321.11
5.6.210.0170.06720.51
5.6.200.0030.07718.09
5.6.190.0600.06320.77
5.6.180.0400.06020.47
5.6.170.0500.05320.55
5.6.160.0570.05320.60
5.6.150.0470.05720.26
5.6.140.0500.06720.33
5.6.130.0500.05320.32
5.6.120.0130.05720.41
5.6.110.0600.05320.39
5.6.100.0570.06320.12
5.6.90.0600.05720.41
5.6.80.0430.06019.70
5.6.70.0530.05019.82
5.6.60.0430.05719.58
5.6.50.0600.04019.73
5.6.40.0600.05319.88
5.6.30.0570.05719.63
5.6.20.0530.05719.67
5.6.10.0600.05319.68
5.6.00.0530.07719.64
5.5.350.0030.04020.47
5.5.340.0070.08017.98
5.5.330.0600.06720.40
5.5.320.0570.04020.40
5.5.310.0470.05720.35
5.5.300.0530.05720.13
5.5.290.0430.06020.12
5.5.280.0070.06320.33
5.5.270.0400.06720.00
5.5.260.0570.06020.11
5.5.250.0600.05319.82
5.5.240.0600.04719.59
5.5.230.0630.05319.38
5.5.220.0400.06719.46
5.5.210.0230.07319.55
5.5.200.0570.05019.50
5.5.190.0500.05019.45
5.5.180.0500.05719.56
5.5.160.0470.05719.36
5.5.150.0470.05719.45
5.5.140.0170.05319.44
5.5.130.0170.06019.29
5.5.120.0300.06719.48
5.5.110.0670.05019.28
5.5.100.0700.04319.20
5.5.90.0470.07319.45
5.5.80.0130.05319.34
5.5.70.0200.05319.39
5.5.60.0130.05719.38
5.5.50.0630.05319.36
5.5.40.0070.06319.56
5.5.30.0130.05719.45
5.5.20.0400.04019.29
5.5.10.0130.07019.24
5.5.00.0230.05019.48

preferences:
33.04 ms | 403 KiB | 5 Q