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 "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.0170.00320.61
8.4.110.0100.00918.87
8.4.100.0120.00817.71
8.4.90.0130.00817.97
8.4.80.0090.01017.99
8.4.70.0090.00317.76
8.4.60.0110.01018.78
8.4.50.0130.00717.84
8.4.40.0130.00617.59
8.4.30.0050.00320.55
8.4.20.0040.00417.90
8.4.10.0050.00519.56
8.3.250.0130.00718.76
8.3.240.0120.00716.65
8.3.230.0110.00916.57
8.3.220.0050.00317.05
8.3.210.0020.00516.52
8.3.200.0080.00416.59
8.3.190.0060.01318.81
8.3.180.0200.01016.32
8.3.170.0190.00019.18
8.3.160.0070.01116.48
8.3.150.0120.00617.37
8.3.140.0040.00418.44
8.3.130.0030.00616.32
8.3.120.0060.00318.88
8.3.110.0080.00016.41
8.3.100.0040.00422.15
8.3.90.0040.00426.77
8.3.80.0030.00619.36
8.3.70.0120.00918.30
8.3.60.0100.01018.07
8.3.50.0130.00524.59
8.3.40.0090.00618.72
8.3.30.0110.00418.50
8.3.20.0060.00324.18
8.3.10.0000.00824.66
8.3.00.0000.00826.16
8.2.290.0140.00520.81
8.2.280.0100.00618.41
8.2.270.0140.00416.77
8.2.260.0000.01718.99
8.2.250.0100.00016.92
8.2.240.0080.00816.86
8.2.230.0080.00020.94
8.2.220.0000.00924.06
8.2.210.0040.01426.77
8.2.200.0040.00418.88
8.2.190.0170.00318.41
8.2.180.0090.00625.92
8.2.170.0120.00319.13
8.2.160.0060.00922.96
8.2.150.0040.00425.66
8.2.140.0070.00024.66
8.2.130.0080.00026.16
8.2.120.0070.00026.35
8.2.110.0060.00320.91
8.2.100.0040.00717.79
8.2.90.0000.00817.88
8.2.80.0040.00418.81
8.2.70.0050.00517.36
8.2.60.0000.00817.75
8.2.50.0000.00818.05
8.2.40.0080.00018.28
8.2.30.0040.00417.95
8.2.20.0000.00717.97
8.2.10.0040.00419.34
8.2.00.0040.00419.29
8.1.330.0090.01018.42
8.1.320.0110.00816.04
8.1.310.0080.00016.96
8.1.300.0030.00516.33
8.1.290.0050.00530.84
8.1.280.0190.00025.92
8.1.270.0080.00023.99
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0060.00322.01
8.1.230.0080.00318.87
8.1.220.0030.00517.74
8.1.210.0060.00318.77
8.1.200.0000.00817.23
8.1.190.0040.00417.23
8.1.180.0000.00818.10
8.1.170.0040.00418.43
8.1.160.0030.00518.89
8.1.150.0060.00618.82
8.1.140.0070.00018.91
8.1.130.0000.00720.14
8.1.120.0040.00417.34
8.1.110.0040.00417.43
8.1.100.0040.00417.37
8.1.90.0040.00417.48
8.1.80.0040.00417.44
8.1.70.0040.00417.40
8.1.60.0070.00217.48
8.1.50.0040.00417.46
8.1.40.0040.00417.42
8.1.30.0040.00417.60
8.1.20.0000.00817.71
8.1.10.0060.00317.46
8.1.00.0030.00617.45
8.0.300.0050.00318.77
8.0.290.0050.00316.75
8.0.280.0000.00718.37
8.0.270.0040.00418.00
8.0.260.0030.00318.59
8.0.250.0070.00017.01
8.0.240.0070.00017.07
8.0.230.0080.00016.92
8.0.220.0000.00716.94
8.0.210.0030.00317.01
8.0.200.0000.00717.02
8.0.190.0000.00717.01
8.0.180.0000.00716.96
8.0.170.0060.00317.02
8.0.160.0040.00417.01
8.0.150.0040.00416.86
8.0.140.0000.00716.91
8.0.130.0030.00313.36
8.0.120.0000.00716.83
8.0.110.0050.00316.96
8.0.100.0040.00416.90
8.0.90.0070.00016.79
8.0.80.0050.01216.96
8.0.70.0000.00816.82
8.0.60.0080.00016.69
8.0.50.0040.00416.77
8.0.30.0120.00916.86
8.0.20.0060.01117.06
8.0.10.0180.00917.18
8.0.00.0140.01517.17
7.4.330.0000.00516.73
7.4.320.0000.00716.55
7.4.300.0040.00416.58
7.4.290.0000.00716.48
7.4.280.0000.00816.46
7.4.270.0030.00616.53
7.4.260.0000.00613.20
7.4.250.0080.00016.40
7.4.240.0070.00016.39
7.4.230.0000.00716.29
7.4.220.0030.00516.34
7.4.210.0050.01116.56
7.4.200.0000.00816.62
7.4.150.0160.00916.50
7.4.140.0180.00716.50
7.4.130.0210.00616.40
7.4.120.0160.00816.52
7.4.110.0150.00916.39
7.4.100.0160.00916.44
7.4.90.0160.01316.51
7.4.80.0180.00816.33
7.4.70.0130.01016.39
7.4.60.0180.00916.34
7.4.50.0160.00816.51
7.4.40.0200.00616.43
7.4.30.0160.01016.45
7.4.20.0140.01116.47
7.4.10.0130.01216.41
7.4.00.0110.01016.43
7.3.330.0050.00516.23
7.3.320.0000.00713.20
7.3.310.0030.00316.29
7.3.300.0000.00616.23
7.3.290.0100.00616.28
7.3.270.0210.00516.31
7.3.260.0200.00716.39
7.3.250.0160.01016.39
7.3.240.0200.00716.24
7.3.230.0150.00816.40
7.3.220.0200.00916.34
7.3.210.0200.00816.27
7.3.200.0100.01416.27
7.3.190.0180.00716.48
7.3.180.0170.00716.46
7.3.170.0180.00816.41
7.3.160.0160.01016.52
7.3.150.0150.01116.48
7.3.140.0200.00516.48
7.3.130.0160.01216.43
7.3.120.0150.00916.46
7.3.110.0140.01016.42
7.3.100.0200.00516.40
7.3.90.0170.01116.35
7.3.80.0120.01016.28
7.3.70.0150.00716.18
7.3.60.0190.00516.33
7.3.50.0160.00716.26
7.3.40.0180.00616.36
7.3.30.0120.01516.35
7.3.20.0330.01116.30
7.3.10.0170.00816.30
7.3.00.0380.00316.30

preferences:
29.01 ms | 403 KiB | 5 Q