3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = [2 => [0 => 41000, 1 => 31079], 3 => [0 => 42963, 1 => 41189]]; $arr2 = [2 => [0 => 40213, 1 => 42054], 3 => [0 => 42998, 1 => 34567]]; function addArray(&$bucket, $water) { foreach ($water as $key => $drop) { $bucket[$key] = array_merge($bucket[$key] ?? [], $drop); } } $combined = []; addArray($combined, $arr1); addArray($combined, $arr2); var_export($combined);

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.130.0080.00317.85
8.4.120.0130.00722.52
8.4.110.0050.00422.24
8.4.100.0140.00617.61
8.4.90.0110.00817.56
8.4.80.0060.00319.40
8.4.70.0070.00417.74
8.4.60.0120.00617.64
8.4.50.0120.00717.66
8.4.40.0070.01117.86
8.4.30.0130.00720.53
8.4.20.0140.00719.63
8.4.10.0040.00421.86
8.3.260.0140.00416.35
8.3.250.0120.00718.92
8.3.240.0120.00817.38
8.3.230.0100.00816.61
8.3.220.0040.00417.02
8.3.210.0090.00516.83
8.3.200.0120.00816.52
8.3.190.0140.00418.16
8.3.180.0070.00216.37
8.3.170.0090.00916.97
8.3.160.0070.01116.70
8.3.150.0040.00417.01
8.3.140.0070.00716.84
8.3.130.0180.00016.41
8.3.120.0090.00018.63
8.3.110.0060.00316.53
8.3.100.0040.01116.46
8.3.90.0100.00726.77
8.3.80.0160.00016.75
8.3.70.0120.00616.58
8.3.60.0110.00416.38
8.3.50.0100.00720.15
8.3.40.0040.01420.39
8.3.30.0110.00718.73
8.3.20.0040.00424.18
8.3.10.0090.00024.66
8.3.00.0040.00426.16
8.2.290.0110.00820.37
8.2.280.0120.00718.63
8.2.270.0130.00616.86
8.2.260.0150.00318.79
8.2.250.0110.00418.18
8.2.240.0030.00616.72
8.2.230.0030.00620.94
8.2.220.0030.00524.06
8.2.210.0100.01026.77
8.2.200.0070.00316.50
8.2.190.0170.00316.58
8.2.180.0100.00725.92
8.2.170.0090.00618.81
8.2.160.0100.01022.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0050.00226.16
8.2.120.0050.00220.98
8.2.110.0030.00622.11
8.2.100.0040.00817.69
8.2.90.0040.00417.84
8.2.80.0030.00519.16
8.2.70.0000.01217.63
8.2.60.0050.00318.16
8.2.50.0030.00618.07
8.2.40.0040.00418.35
8.2.30.0040.00419.83
8.2.20.0000.00819.21
8.2.10.0000.00718.16
8.2.00.0060.00319.34
8.1.330.0060.00321.72
8.1.320.0110.00916.07
8.1.310.0110.00716.55
8.1.300.0030.00617.63
8.1.290.0090.00330.84
8.1.280.0070.00725.92
8.1.270.0040.00424.66
8.1.260.0060.00326.35
8.1.250.0120.00628.09
8.1.240.0090.00022.46
8.1.230.0120.00020.99
8.1.220.0050.00317.79
8.1.210.0030.00518.96
8.1.200.0060.00317.35
8.1.190.0030.00517.35
8.1.180.0040.00418.10
8.1.170.0080.00018.83
8.1.160.0040.00418.82
8.1.150.0040.00418.59
8.1.140.0040.00417.41
8.1.130.0040.00418.99
8.1.120.0000.00817.43
8.1.110.0090.00617.45
8.1.100.0100.00517.42
8.1.90.0110.00517.36
8.1.80.0100.00617.40
8.1.70.0120.00617.39
8.1.60.0120.00717.61
8.1.50.0100.00817.51
8.1.40.0140.00617.45
8.1.30.0200.00217.59
8.1.20.0130.00617.56
8.1.10.0120.00817.53
8.1.00.0130.00517.49
8.0.300.0040.00419.96
8.0.290.0000.00716.75
8.0.280.0000.00718.39
8.0.270.0030.00317.29
8.0.260.0030.00318.45
8.0.250.0000.00716.88
8.0.240.0070.00316.91
8.0.230.0110.00516.92
8.0.220.0130.00416.86
8.0.210.0130.00416.84
8.0.200.0110.00516.89
8.0.190.0090.00616.84
8.0.180.0100.00516.84
8.0.170.0110.00516.77
8.0.160.0090.00716.88
8.0.150.0100.00716.71
8.0.140.0100.00516.83
8.0.130.0120.00416.83
8.0.120.0150.00216.86
8.0.110.0110.00416.81
8.0.100.0100.00516.79
8.0.90.0100.00416.84
8.0.80.0110.00516.87
8.0.70.0110.00516.76
8.0.60.0080.00716.80
8.0.50.0090.00616.84
8.0.30.0130.00316.83
8.0.20.0110.00516.87
8.0.10.0140.00316.96
7.4.330.0000.00615.55
7.4.320.0140.00316.54
7.4.300.0070.00716.48
7.4.290.0110.00516.52
7.4.280.0120.00616.57
7.4.270.0130.00416.53
7.4.260.0110.00716.50
7.4.250.0130.00516.52
7.4.240.0080.00716.50
7.4.230.0110.00416.50
7.4.220.0090.00516.53
7.4.210.0080.00716.53
7.4.200.0080.00716.56
7.4.190.0100.00416.59
7.4.180.0060.00816.58
7.4.160.0090.00316.57
7.4.150.0090.00216.48
7.4.140.0090.00316.49
7.4.130.0070.00616.39
7.4.120.0080.00516.38
7.4.110.0080.00616.35
7.4.100.0090.00416.46
7.4.90.0120.00116.42
7.4.80.0080.00516.35
7.4.70.0070.00516.36
7.4.60.0070.00616.43
7.4.50.0080.00616.36
7.4.40.0080.00516.31
7.4.30.0060.00516.46
7.4.20.0070.00416.35
7.4.10.0090.00116.43
7.4.00.0050.00516.49

preferences:
28.59 ms | 403 KiB | 5 Q