3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['term_title' => 'black'], ['color_quantity' => 2], ['color_price' => 22], ['term_title' => 'blue'], ['color_quantity' => 3], ['color_price' => 33], ]; foreach ($array as $index => $subarray) { $key = key($subarray); $result[intdiv($index, 3)][$key] = $subarray[$key]; } var_export($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.3.70.0110.00418.31
8.3.60.0070.00718.43
8.3.50.0070.01420.27
8.3.40.0030.01020.43
8.3.30.0000.01518.85
8.3.20.0090.00924.18
8.3.10.0080.00024.66
8.3.00.0080.00026.16
8.2.190.0080.00816.75
8.2.180.0210.00025.92
8.2.170.0070.01119.09
8.2.160.0070.00722.96
8.2.150.0050.00325.66
8.2.140.0140.00424.66
8.2.130.0070.00026.16
8.2.120.0080.00021.02
8.2.110.0060.00320.56
8.2.100.0110.00018.28
8.2.90.0080.00019.33
8.2.80.0030.01017.97
8.2.70.0060.00317.75
8.2.60.0030.00617.93
8.2.50.0030.00518.07
8.2.40.0040.00417.91
8.2.30.0000.00718.06
8.2.20.0040.00419.38
8.2.10.0000.00718.02
8.2.00.0030.00519.20
8.1.280.0070.00725.92
8.1.270.0040.00424.66
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00722.04
8.1.230.0040.00717.83
8.1.220.0030.00517.78
8.1.210.0030.00518.77
8.1.200.0060.00317.36
8.1.190.0040.00417.36
8.1.180.0000.00818.10
8.1.170.0060.00318.55
8.1.160.0000.00718.81
8.1.150.0040.00418.65
8.1.140.0070.00017.39
8.1.130.0030.00318.90
8.1.120.0070.00017.48
8.1.110.0060.00317.51
8.1.100.0140.00317.39
8.1.90.0110.00517.43
8.1.80.0130.00417.35
8.1.70.0150.00017.41
8.1.60.0150.00217.60
8.1.50.0130.00417.41
8.1.40.0090.00917.45
8.1.30.0150.00317.68
8.1.20.0160.00017.55
8.1.10.0130.00517.47
8.1.00.0150.00317.48
8.0.300.0000.00718.77
8.0.290.0080.00016.63
8.0.280.0050.00218.36
8.0.270.0000.00817.95
8.0.260.0030.00318.41
8.0.250.0000.00716.95
8.0.240.0030.00316.93
8.0.230.0110.00416.95
8.0.220.0000.01516.90
8.0.210.0100.00316.82
8.0.200.0120.00416.93
8.0.190.0160.00016.81
8.0.180.0130.00416.93
8.0.170.0140.00016.79
8.0.160.0100.00516.89
8.0.150.0150.00016.67
8.0.140.0070.00716.87
8.0.130.0110.00716.93
8.0.120.0150.00316.91
8.0.110.0090.00616.71
8.0.100.0120.00416.87
8.0.90.0100.00516.86
8.0.80.0130.00516.80
8.0.70.0080.00916.92
8.0.60.0130.00616.72
8.0.50.0120.00616.59
8.0.30.0130.00516.92
8.0.20.0140.00616.86
8.0.10.0180.00016.99
7.4.330.0000.00515.55
7.4.320.0060.00316.59
7.4.300.0120.00816.50
7.4.290.0140.00416.44
7.4.280.0100.00316.50
7.4.270.0040.00816.55
7.4.260.0090.00316.42
7.4.250.0070.00716.44
7.4.240.0140.00416.57
7.4.230.0150.00316.48
7.4.220.0140.00316.58
7.4.210.0130.00416.42
7.4.200.0130.00516.58
7.4.190.0100.00616.54
7.4.180.0130.00416.57
7.4.160.0170.00016.45
7.4.150.0170.00016.53
7.4.140.0080.00816.44
7.4.130.0100.00616.29
7.4.120.0130.00416.43
7.4.110.0160.00016.47
7.4.100.0160.00216.57
7.4.90.0110.00716.44
7.4.80.0100.00716.41
7.4.70.0170.00016.34
7.4.60.0130.00416.40
7.4.50.0100.00716.37
7.4.40.0130.00316.38
7.4.30.0130.00316.31
7.4.20.0090.00616.50
7.4.10.0120.00516.51
7.4.00.0160.00016.41

preferences:
47.81 ms | 402 KiB | 5 Q