3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = '1,Home,3,Services,6,Service 1,7,Service 2,2,Products'; $keysAndValues = explode(',', $input); $result = []; $count = count($keysAndValues); for ($i = 0; $i < $count; $i+=2) { $key = $keysAndValues[$i]; $value = $keysAndValues[$i+1]; $result[$key] = $value; } var_dump($result);

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.20.0040.01517.83
8.4.10.0080.00020.55
8.3.150.0110.00820.78
8.3.140.0000.00818.92
8.3.130.0040.00418.38
8.3.120.0060.01319.08
8.3.110.0040.00720.94
8.3.100.0030.00624.06
8.3.90.0000.00826.77
8.3.80.0000.00916.50
8.3.70.0070.01116.58
8.3.60.0130.00616.48
8.3.50.0100.00824.63
8.3.40.0100.01318.66
8.3.30.0140.00018.71
8.3.20.0080.00024.18
8.3.10.0040.00424.66
8.3.00.0060.00326.16
8.2.270.0030.01517.16
8.2.260.0070.00720.04
8.2.250.0030.00716.69
8.2.240.0090.00017.10
8.2.230.0050.00522.58
8.2.220.0060.00337.54
8.2.210.0140.00726.77
8.2.200.0030.00716.75
8.2.190.0090.01316.63
8.2.180.0000.01425.92
8.2.170.0120.00919.13
8.2.160.0140.00422.96
8.2.150.0040.00425.66
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0040.00426.35
8.2.110.0090.00022.25
8.2.100.0080.00417.78
8.2.90.0050.00319.21
8.2.80.0030.00617.97
8.2.70.0040.00417.63
8.2.60.0000.00817.79
8.2.50.0000.00818.07
8.2.40.0000.00818.08
8.2.30.0000.00718.27
8.2.20.0040.00418.16
8.2.10.0040.00419.26
8.2.00.0040.00419.24
8.1.310.0060.00916.64
8.1.300.0130.00716.52
8.1.290.0090.00618.88
8.1.280.0140.00325.92
8.1.270.0090.00023.99
8.1.260.0040.00428.09
8.1.250.0080.00028.09
8.1.240.0030.00622.16
8.1.230.0000.01122.11
8.1.220.0050.00317.79
8.1.210.0030.00518.77
8.1.200.0030.00617.24
8.1.190.0030.00517.35
8.1.180.0040.00418.10
8.1.170.0040.00418.41
8.1.160.0000.00718.97
8.1.150.0050.00218.93
8.1.140.0000.00720.67
8.1.130.0030.00320.21
8.1.120.0080.00017.49
8.1.110.0040.00417.39
8.1.100.0070.00017.47
8.1.90.0030.00517.39
8.1.80.0070.00017.49
8.1.70.0000.00717.44
8.1.60.0040.00417.58
8.1.50.0000.00817.44
8.1.40.0060.00317.56
8.1.30.0030.00617.71
8.1.20.0000.00817.66
8.1.10.0030.00517.39
8.1.00.0050.00317.32
8.0.300.0000.00718.77
8.0.290.0050.00316.75
8.0.280.0000.00718.40
8.0.270.0030.00317.92
8.0.260.0000.00820.22
8.0.250.0000.00716.92
8.0.240.0040.00416.77
8.0.230.0070.00016.94
8.0.220.0000.00716.82
8.0.210.0030.00316.84
8.0.200.0070.00016.90
8.0.190.0040.00416.89
8.0.180.0000.00716.75
8.0.170.0060.00316.81
8.0.160.0000.00716.87
8.0.150.0040.00416.85
8.0.140.0040.00416.84
8.0.130.0030.00313.38
8.0.120.0040.00416.91
8.0.110.0000.00716.79
8.0.100.0080.00016.75
8.0.90.0000.00716.97
8.0.80.0070.00916.94
8.0.70.0070.00016.89
8.0.60.0040.00416.78
8.0.50.0050.00216.79
8.0.30.0110.00616.96
8.0.20.0110.00917.16
8.0.10.0040.00417.02
8.0.00.0060.01216.79
7.4.330.0000.00715.55
7.4.320.0030.00316.66
7.4.300.0030.00616.56
7.4.290.0070.00016.61
7.4.280.0040.00416.36
7.4.270.0000.00816.64
7.4.260.0030.00313.25
7.4.250.0030.00516.60
7.4.240.0070.00016.50
7.4.230.0000.00816.36
7.4.220.0050.00216.45
7.4.210.0100.00916.64
7.4.200.0000.00816.36
7.4.130.0130.00616.48
7.4.120.0100.00616.58
7.4.110.0100.00716.62
7.4.100.0110.01116.54
7.4.90.0120.00516.59
7.4.80.0040.01416.52
7.4.70.0150.01116.39
7.4.60.0130.00916.20
7.4.50.0090.01216.25
7.4.40.0130.00816.51
7.4.30.0200.00016.46
7.4.20.0090.00916.38
7.4.10.0100.01416.41
7.4.00.0060.01216.48
7.3.330.0080.00016.25
7.3.320.0000.00713.26
7.3.310.0070.00016.40
7.3.300.0070.00016.32
7.3.290.0060.00816.36
7.3.260.0140.00716.28
7.3.230.0120.00616.25
7.3.210.0100.00716.34
7.3.200.0150.00516.40
7.3.190.0100.01516.21
7.3.180.0220.02016.59
7.3.170.0110.01416.23
7.3.160.0060.01216.50
7.3.150.0100.01016.32
7.3.140.0080.00816.44
7.3.130.0060.01216.23
7.3.120.0060.01116.68
7.3.110.0110.01016.31
7.3.100.0130.00416.41
7.3.90.0110.01116.35
7.3.80.0140.00616.30
7.3.70.0080.00816.34
7.3.60.0060.01016.29
7.3.50.0070.01016.26
7.3.40.0000.01616.50
7.3.30.0080.00816.45
7.3.20.0120.00616.27
7.3.10.0040.01616.48
7.3.00.0130.00916.57
7.2.330.0130.00716.43
7.2.320.0060.01916.51
7.2.310.0150.00916.66
7.2.300.0030.02016.50
7.2.290.0030.01616.82
7.2.280.0100.01316.52
7.2.270.0090.01216.41
7.2.260.0140.00316.75
7.2.250.0150.00616.35
7.2.240.0110.01116.82
7.2.230.0100.00716.49
7.2.220.0090.00916.45
7.2.210.0100.00716.72
7.2.200.0120.00616.47
7.2.190.0070.01116.46
7.2.180.0200.00316.57
7.2.170.0070.01016.62
7.2.160.0160.00016.74
7.2.150.0090.00916.64
7.2.140.0100.01116.68
7.2.130.0090.01216.70
7.2.120.0070.01416.55
7.2.110.0190.00516.58
7.2.100.0120.01216.75
7.2.90.0080.01616.57
7.2.80.0070.01116.57
7.2.70.0210.00316.64
7.2.60.0130.00616.51
7.2.50.0150.00416.82
7.2.40.0130.00616.62
7.2.30.0130.01016.75
7.2.20.0110.00816.55
7.2.10.0250.00716.55
7.2.00.0060.01116.60

preferences:
117.14 ms | 403 KiB | 5 Q