3v4l.org

run code in 300+ PHP versions simultaneously
<?php $years = array( array(2015 => '2015'), array(2016 => '2016'), array(2017 => '2017'), array(2018 => '2018'), array(2019 => '2019'), array(2020 => '2020'), array(2021 => '2021'), array(2022 => '2022'), array(2023 => '2023') ); // var_export(array_merge(...$years)); // loses numeric associative keys // var_export(call_user_func_array('array_merge', $years)); // loses numeric associative keys // var_export(array_reduce($years, 'array_merge', array())); // loses numeric associative keys var_export(iterator_to_array(new RecursiveIteratorIterator(new RecursiveArrayIterator($years))));

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.0160.00517.59
8.4.120.0100.01120.59
8.4.110.0140.00618.83
8.4.100.0130.00717.56
8.4.90.0130.00817.56
8.4.80.0060.00317.55
8.4.70.0040.00419.25
8.4.60.0120.00618.67
8.4.50.0040.00418.54
8.4.40.0090.00919.21
8.4.30.0110.00718.93
8.4.20.0100.00625.88
8.4.10.0040.00822.21
8.3.260.0100.00616.40
8.3.250.0110.00819.02
8.3.240.0140.00616.51
8.3.230.0120.00816.79
8.3.220.0100.00916.43
8.3.210.0130.00416.54
8.3.200.0060.01316.48
8.3.190.0120.01217.07
8.3.180.0140.00516.91
8.3.170.0030.01018.99
8.3.160.0110.00717.04
8.3.150.0100.01017.07
8.3.140.0000.00816.66
8.3.130.0080.00018.33
8.3.120.0130.00616.46
8.3.110.0000.01516.49
8.3.100.0080.00818.45
8.3.90.0110.00426.77
8.3.80.0050.00517.97
8.3.70.0070.01016.60
8.3.60.0110.01118.18
8.3.50.0140.00716.43
8.3.40.0040.01120.38
8.3.30.0110.00318.54
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0000.00726.16
8.2.290.0120.00620.27
8.2.280.0060.01218.46
8.2.270.0160.00317.45
8.2.260.0040.01116.77
8.2.250.0080.00016.69
8.2.240.0040.00818.73
8.2.230.0030.00720.94
8.2.220.0060.00324.06
8.2.210.0080.00026.77
8.2.200.0090.00018.29
8.2.190.0080.00816.58
8.2.180.0070.00716.75
8.2.170.0140.00718.82
8.2.160.0140.00022.96
8.2.150.0050.00325.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0030.00626.16
8.2.110.0030.00720.53
8.2.100.0080.00317.78
8.2.90.0040.00417.68
8.2.80.0050.00317.48
8.2.70.0040.00417.13
8.2.60.0000.00720.53
8.2.50.0030.00518.07
8.2.40.0080.00019.95
8.2.30.0000.00818.02
8.2.20.0040.00419.13
8.2.10.0000.01217.73
8.2.00.0000.01917.49
8.1.330.0080.00518.29
8.1.320.0130.00616.28
8.1.310.0170.00016.68
8.1.300.0000.00820.16
8.1.290.0070.00418.88
8.1.280.0140.00325.92
8.1.270.0080.00021.98
8.1.260.0000.00728.09
8.1.250.0040.00428.09
8.1.240.0030.00622.47
8.1.230.0040.00820.96
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0060.00317.10
8.1.190.0000.00817.23
8.1.180.0000.00818.10
8.1.170.0050.00218.87
8.1.160.0050.00218.83
8.1.150.0000.00918.55
8.1.140.0000.01317.37
8.1.130.0110.00617.22
8.1.120.0050.01117.42
8.1.110.0090.00917.34
8.1.100.0160.00317.38
8.1.90.0130.00217.28
8.1.80.0180.00217.44
8.1.70.0160.00017.45
8.1.60.0080.00817.57
8.1.50.0160.00417.36
8.1.40.0120.00617.59
8.1.30.0120.00417.49
8.1.20.0190.00017.58
8.1.10.0160.00317.52
8.1.00.0110.00817.36
8.0.300.0040.00420.02
8.0.290.0040.00416.62
8.0.280.0030.00318.29
8.0.270.0130.00316.73
8.0.260.0090.00616.55
8.0.250.0170.00016.81
8.0.240.0030.01416.81
8.0.230.0120.00316.85
8.0.220.0060.00916.71
8.0.210.0050.01016.72
8.0.200.0080.00416.81
8.0.190.0000.01216.88
8.0.180.0090.00516.81
8.0.170.0000.01616.71
8.0.160.0000.01616.80
8.0.150.0120.00316.70
8.0.140.0120.00416.69
8.0.130.0120.00416.59
8.0.120.0100.00716.62
8.0.110.0160.00016.72
8.0.100.0170.00016.75
8.0.90.0130.00316.73
8.0.80.0100.00616.62
8.0.70.0110.00316.70
8.0.60.0110.00516.71
8.0.50.0110.00416.65
8.0.30.0120.00316.73
8.0.20.0170.00016.78
8.0.10.0050.01016.77

preferences:
57.89 ms | 403 KiB | 5 Q