3v4l.org

run code in 300+ PHP versions simultaneously
<?php $source = ["a" => 1, "b" => 2, "c" => 3]; $input = ["d" => 4, "b" => 10]; echo "With + operator:\n"; echo "input + source | " . json_encode($input + $source) . PHP_EOL; echo "source + input | " . json_encode($source + $input) . PHP_EOL; echo "source + input + source | " . json_encode($source + ($input + $source)) . PHP_EOL; echo "With array_merge:\n"; echo "input + source | " . json_encode(array_merge($input, $source)) . PHP_EOL; echo "source + input | " . json_encode(array_merge($source, $input)) . PHP_EOL;

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.120.0070.00520.12
8.4.110.0100.01022.39
8.4.100.0100.00518.59
8.4.90.0070.00418.94
8.4.80.0110.00818.45
8.4.70.0040.00418.00
8.4.60.0150.00618.91
8.4.50.0080.01318.60
8.4.40.0150.00617.78
8.4.30.0140.00720.52
8.4.20.0080.00318.13
8.4.10.0060.00319.44
8.3.250.0100.00819.03
8.3.240.0140.00516.84
8.3.230.0110.00516.74
8.3.220.0050.00318.95
8.3.210.0140.00918.58
8.3.200.0040.00516.41
8.3.190.0150.00517.16
8.3.180.0040.00416.37
8.3.170.0110.00320.86
8.3.160.0090.00916.96
8.3.150.0150.00316.94
8.3.140.0120.00618.20
8.3.130.0000.00816.48
8.3.120.0100.00620.75
8.3.110.0040.00416.62
8.3.100.0030.00624.06
8.3.90.0040.00426.77
8.3.80.0030.00619.36
8.3.70.0040.01118.15
8.3.60.0060.01018.43
8.3.50.0070.01224.59
8.3.40.0150.00618.84
8.3.30.0110.00418.71
8.3.20.0050.00224.18
8.3.10.0060.00324.66
8.3.00.0070.00026.16
8.2.290.0130.00820.61
8.2.280.0040.00618.44
8.2.270.0110.00717.06
8.2.260.0130.00716.80
8.2.250.0040.00416.36
8.2.240.0160.00018.88
8.2.230.0040.00420.94
8.2.220.0080.00337.54
8.2.210.0040.00426.77
8.2.200.0040.00418.88
8.2.190.0030.01018.29
8.2.180.0100.00725.92
8.2.170.0070.00718.94
8.2.160.0070.00722.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0060.00326.16
8.2.120.0040.00426.35
8.2.110.0060.00322.25
8.2.100.0040.00817.69
8.2.90.0080.00017.88
8.2.80.0030.00618.77
8.2.70.0000.00817.63
8.2.60.0000.00818.16
8.2.50.0100.00018.05
8.2.40.0000.00818.22
8.2.30.0040.00418.11
8.2.20.0000.00718.07
8.2.10.0040.00419.20
8.2.00.0070.00019.15
8.1.330.0090.01022.02
8.1.320.0130.00515.93
8.1.310.0100.00718.55
8.1.300.0130.00618.50
8.1.290.0090.00030.84
8.1.280.0120.00325.92
8.1.270.0040.00423.99
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0060.00322.19
8.1.230.0070.00717.76
8.1.220.0050.00317.74
8.1.210.0030.00518.77
8.1.200.0000.00917.38
8.1.190.0080.00017.23
8.1.180.0050.00318.10
8.1.170.0000.00918.53
8.1.160.0000.00918.83
8.1.150.0040.00418.75
8.1.140.0040.00418.94
8.1.130.0000.00720.13
8.1.120.0000.00817.32
8.1.110.0000.00817.33
8.1.100.0000.00817.34
8.1.90.0030.00317.44
8.1.80.0000.01017.43
8.1.70.0000.00617.41
8.1.60.0040.00417.59
8.1.50.0000.00817.45
8.1.40.0000.00817.46
8.1.30.0000.00817.64
8.1.20.0040.00417.50
8.1.10.0070.00017.52
8.1.00.0030.00617.42
8.0.300.0060.00318.77
8.0.290.0000.00816.88
8.0.280.0070.00018.29
8.0.270.0070.00017.96
8.0.260.0030.00318.57
8.0.250.0080.00016.90
8.0.240.0030.00317.03
8.0.230.0000.00816.89
8.0.220.0000.00716.82
8.0.210.0040.00416.96
8.0.200.0000.00717.02
8.0.190.0050.00317.05
8.0.180.0030.00617.02
8.0.170.0030.00616.96
8.0.160.0030.00316.88
8.0.150.0000.00716.81
8.0.140.0060.00316.82
8.0.130.0000.00513.33
8.0.120.0000.00716.91
8.0.110.0000.00816.90
8.0.100.0000.00816.79
8.0.90.0040.00416.84
8.0.80.0100.00616.86
8.0.70.0040.00416.98
8.0.60.0000.00716.88
8.0.50.0000.00716.94
8.0.30.0080.00817.09
8.0.20.0110.00916.97
8.0.10.0140.00516.85
8.0.00.0140.00617.11
7.4.330.0020.00216.76
7.4.320.0000.00716.44
7.4.300.0030.00316.40
7.4.290.0080.00016.49
7.4.280.0040.00416.31
7.4.270.0040.00416.41
7.4.260.0000.00513.32
7.4.250.0030.00316.50
7.4.240.0020.00516.54
7.4.230.0030.00316.43
7.4.220.0020.00516.50
7.4.210.0080.01016.52
7.4.200.0030.00316.50
7.4.150.0090.00916.38
7.4.140.0180.00416.26
7.4.130.0070.01416.55
7.4.120.0170.00816.52
7.4.110.0140.01016.47
7.4.100.0110.00516.38
7.4.90.0030.01216.35
7.4.80.0090.01316.21
7.4.70.0140.00516.25
7.4.60.0070.01116.15
7.4.50.0040.01316.50
7.4.40.0090.00916.14
7.4.30.0150.00916.42
7.4.20.0080.01116.54
7.4.10.0120.00616.30
7.4.00.0070.01016.52
7.3.330.0000.00916.20
7.3.320.0000.00612.98
7.3.310.0030.00316.26
7.3.300.0030.00316.15
7.3.290.0030.01116.22
7.3.270.0060.01316.30
7.3.260.0060.01216.49
7.3.250.0030.01716.13
7.3.240.0160.00016.27
7.3.230.0200.00316.46
7.3.220.0130.00316.13
7.3.210.0100.00716.05
7.3.200.0150.00816.21
7.3.190.0140.00316.45
7.3.180.0140.00416.54
7.3.170.0100.00916.40
7.3.160.0120.01216.37
7.3.150.0140.00316.57
7.3.140.0040.01216.45
7.3.130.0050.01116.23
7.3.120.0170.00416.25
7.3.110.0110.00816.47
7.3.100.0190.00716.38
7.3.90.0070.01016.27
7.3.80.0090.00916.18
7.3.70.0110.00616.07
7.3.60.0070.01116.07
7.3.50.0030.01316.16
7.3.40.0140.00316.24
7.3.30.0100.00916.09
7.3.20.0140.00416.16
7.3.10.0150.00416.16
7.3.00.0040.01316.15

preferences:
29.01 ms | 403 KiB | 5 Q