3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a1 = [ ['id' => 5, 'cnt' => 14], ['id' => 8, 'cnt' => 2], ]; $a2 = [ ['id' => 8, 'binding' => 'hardcover'], ['id' => 5, 'binding' => 'softcover'], ]; $result = []; foreach (array_merge($a1, $a2) as $row) { $result[$row['id']] = ($result[$row['id']] ?? []) + $row; } var_export(array_values($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.0140.00416.58
8.3.60.0090.00918.39
8.3.50.0140.00720.22
8.3.40.0100.00321.91
8.3.30.0100.00319.13
8.3.20.0040.00424.18
8.3.10.0000.00824.66
8.3.00.0040.00426.16
8.2.190.0040.01118.16
8.2.180.0070.00725.92
8.2.170.0140.00719.09
8.2.160.0030.01022.96
8.2.150.0070.00025.66
8.2.140.0080.00024.66
8.2.130.0000.00726.16
8.2.120.0040.00419.79
8.2.110.0030.00622.17
8.2.100.0060.00618.03
8.2.90.0100.00318.22
8.2.80.0000.00818.83
8.2.70.0100.00317.44
8.2.60.0070.00617.64
8.2.50.0100.00417.79
8.2.40.0080.00617.92
8.2.30.0080.00517.76
8.2.20.0070.00619.01
8.2.10.0040.00817.79
8.2.00.0060.00618.47
8.1.280.0060.00925.92
8.1.270.0000.00823.99
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0090.00023.83
8.1.230.0110.00019.01
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0100.00417.05
8.1.190.0080.00517.24
8.1.180.0110.00417.61
8.1.170.0090.00517.81
8.1.160.0060.00618.13
8.1.150.0060.00617.78
8.1.140.0060.00617.29
8.1.130.0100.00317.34
8.1.120.0090.00417.32
8.1.110.0130.00017.27
8.1.100.0070.00517.30
8.1.90.0090.00517.29
8.1.80.0070.00517.29
8.1.70.0050.00717.18
8.1.60.0090.00617.46
8.1.50.0070.00717.40
8.1.40.0090.00517.39
8.1.30.0080.00717.37
8.1.20.0130.00217.37
8.1.10.0100.00417.25
8.1.00.0100.00517.23
8.0.300.0030.00618.77
8.0.290.0070.00016.69
8.0.280.0070.00617.48
8.0.270.0120.00316.72
8.0.260.0100.00316.76
8.0.250.0100.00216.81
8.0.240.0100.00316.83
8.0.230.0080.00516.79
8.0.220.0100.00316.78
8.0.210.0040.00816.89
8.0.200.0070.00516.85
8.0.190.0050.00716.84
8.0.180.0120.00116.90
8.0.170.0050.00816.77
8.0.160.0100.00516.77
8.0.150.0120.00316.82
8.0.140.0110.00216.91
8.0.130.0100.00416.85
8.0.120.0070.00716.75
8.0.110.0100.00316.79
8.0.100.0070.00716.76
8.0.90.0130.00216.78
8.0.80.0110.00416.68
8.0.70.0130.00116.68
8.0.60.0090.00616.74
8.0.50.0090.00616.69
8.0.30.0080.00616.76
8.0.20.0120.00416.82
8.0.10.0170.00016.81
7.4.330.0080.00216.06
7.4.320.0040.00716.56
7.4.300.0060.00616.62
7.4.290.0140.00516.53
7.4.280.0120.00616.61
7.4.270.0150.00416.54
7.4.260.0140.00516.59
7.4.250.0120.00416.57
7.4.240.0090.00816.56
7.4.230.0120.00616.59
7.4.220.0100.00616.58
7.4.210.0110.00316.55
7.4.200.0100.00416.61
7.4.190.0080.00616.58
7.4.180.0080.00616.61
7.4.160.0140.00116.52
7.4.150.0070.00616.51
7.4.140.0080.00616.57
7.4.130.0110.00616.51
7.4.120.0120.00216.52
7.4.110.0120.00216.52
7.4.100.0090.00516.48
7.4.90.0110.00316.51
7.4.80.0090.00516.51
7.4.70.0150.00016.49
7.4.60.0150.00216.53
7.4.50.0120.00416.48
7.4.40.0110.00216.43
7.4.30.0060.00816.51
7.4.20.0080.00616.50
7.4.10.0120.00216.50
7.4.00.0080.00616.39

preferences:
32.33 ms | 401 KiB | 5 Q