3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a1 = [ "a" => 2, "b" => 0, "c" => 5, ]; $a2 = [ "a" => 3, "b" => 9, "c" => 7, "d" => 10, ]; var_export( array_reduce( array_keys($a2), function ($result, $k) use ($a2) { $result[$k] = ($result[$k] ?? 0) + $a2[$k]; return $result; }, $a1 ) );

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.5.30.0120.00519.50
8.5.20.0040.00320.07
8.5.10.0120.00516.55
8.5.00.0090.01220.09
8.4.180.0130.00919.71
8.4.170.0110.01020.57
8.4.160.0130.00823.95
8.4.150.0090.00417.77
8.4.140.0120.00917.55
8.4.130.0050.00517.85
8.4.120.0140.00620.47
8.4.110.0100.00722.31
8.4.100.0140.00717.68
8.4.90.0120.00920.54
8.4.80.0140.00719.00
8.4.70.0100.00818.78
8.4.60.0130.00718.54
8.4.50.0100.00920.60
8.4.40.0130.00717.62
8.4.30.0160.00318.82
8.4.20.0130.00719.54
8.4.10.0080.00019.43
8.3.300.0140.00720.84
8.3.290.0120.00820.73
8.3.280.0090.01118.48
8.3.270.0110.01016.54
8.3.260.0130.00616.68
8.3.250.0110.00718.79
8.3.240.0120.00816.50
8.3.230.0100.00816.73
8.3.220.0040.00318.97
8.3.210.0120.00316.45
8.3.200.0050.00316.84
8.3.190.0120.00618.74
8.3.180.0110.00918.84
8.3.170.0040.01518.87
8.3.160.0060.01217.14
8.3.150.0030.00517.17
8.3.140.0000.00819.02
8.3.130.0000.00818.47
8.3.120.0040.00418.82
8.3.110.0130.00720.94
8.3.100.0080.00024.06
8.3.90.0000.00826.77
8.3.80.0030.00618.43
8.3.70.0090.00916.36
8.3.60.0150.00616.72
8.3.50.0160.00616.59
8.3.40.0110.00421.93
8.3.30.0140.00020.29
8.3.20.0100.01423.69
8.3.10.0080.01523.66
8.3.00.0140.00720.72
8.2.300.0130.00718.76
8.2.290.0090.00920.39
8.2.280.0040.00418.30
8.2.270.0140.00416.92
8.2.260.0030.00616.54
8.2.250.0000.00816.99
8.2.240.0060.00317.17
8.2.230.0000.00822.58
8.2.220.0080.00037.54
8.2.210.0040.00426.77
8.2.200.0090.00018.54
8.2.190.0030.01318.54
8.2.180.0110.00416.38
8.2.170.0090.01222.96
8.2.160.0110.00420.99
8.2.150.0100.01021.00
8.2.140.0070.01122.26
8.2.130.0120.00620.42
8.2.120.0160.00319.26
8.2.110.0070.00719.22
8.2.100.0100.01018.97
8.2.90.0120.00618.96
8.2.80.0100.00319.22
8.2.70.0110.00718.74
8.2.60.0100.00718.70
8.2.50.0090.00619.22
8.2.40.0070.00718.78
8.2.30.0040.01118.69
8.2.20.0090.00618.74
8.2.10.0080.00818.66
8.2.00.0140.00018.69
8.1.340.0140.00817.50
8.1.330.0150.00421.80
8.1.320.0140.00515.92
8.1.310.0120.00618.22
8.1.300.0090.00018.09
8.1.290.0060.00330.84
8.1.280.0170.00025.92
8.1.270.0100.00322.05
8.1.260.0120.00322.12
8.1.250.0040.01122.06
8.1.240.0070.00718.63
8.1.230.0090.00618.62
8.1.220.0080.00818.88
8.1.210.0110.00718.55
8.1.200.0150.00318.86
8.1.190.0140.00318.81
8.1.180.0090.00918.40
8.1.170.0090.00618.78
8.1.160.0100.00618.56
8.1.150.0150.00018.73
8.1.140.0070.00720.21
8.1.130.0070.01120.56
8.1.120.0120.00318.59
8.1.110.0090.00918.63
8.1.100.0100.00721.51
8.1.90.0130.00718.46
8.1.80.0080.01219.92
8.1.70.0080.00818.56
8.1.60.0060.01018.65
8.1.50.0140.00318.51
8.1.40.0110.00618.59
8.1.30.0080.00819.00
8.1.20.0140.00019.96
8.1.10.0110.00318.61
8.1.00.0080.00618.56

preferences:
42.76 ms | 987 KiB | 5 Q