3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a1 = ['a', 'b']; $a2 = ['foo' => 'a', 'bar' => 'b']; $a3 = ['c', 'd']; $a4 = ['zip' => 'c', 'qux' => 'd']; $as = ['a1' => $a1, 'a2' => $a2, 'a3' => $a3, 'a4' => $a4]; foreach ($as as $kx => $ax) { foreach ($as as $ky => $ay) { printf('%s + %s : %s', $kx, $ky, print_r($ax + $ay, true)); echo PHP_EOL; printf('array_merge(%s, %s) : %s', $kx, $ky, print_r(array_merge($ax, $ay), true)); echo 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.3.70.0070.01416.58
8.3.60.0090.00918.43
8.3.50.0120.00522.04
8.3.40.0160.00618.97
8.3.30.0070.00720.17
8.3.20.0000.00720.34
8.3.10.0040.00422.14
8.3.00.0080.00022.51
8.2.180.0140.00718.29
8.2.170.0030.01222.96
8.2.160.0090.00622.30
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0110.00726.16
8.2.120.0080.00019.36
8.2.110.0030.00622.25
8.2.100.0040.00718.03
8.2.90.0080.00019.25
8.2.80.0050.00319.21
8.2.70.0060.00317.63
8.2.60.0080.00018.05
8.2.50.0090.00318.07
8.2.40.0000.00718.16
8.2.30.0050.00218.12
8.2.20.0000.00717.65
8.2.10.0000.00817.91
8.2.00.0030.00517.84
8.1.280.0070.00725.92
8.1.270.0000.00824.66
8.1.260.0000.00826.35
8.1.250.0000.00828.09
8.1.240.0060.00323.89
8.1.230.0060.00619.09
8.1.220.0040.00417.74
8.1.210.0000.00918.77
8.1.200.0060.00317.23
8.1.190.0040.00417.52
8.1.180.0040.00418.10
8.1.170.0100.00018.58
8.1.160.0050.00318.88
8.1.150.0040.00418.51
8.1.140.0000.00817.35
8.1.130.0030.00317.82
8.1.120.0040.00417.47
8.1.110.0040.00417.33
8.1.100.0050.00317.34
8.1.90.0040.00417.45
8.1.80.0050.00217.47
8.1.70.0070.00017.38
8.1.60.0050.00317.62
8.1.50.0040.00417.55
8.1.40.0050.00317.44
8.1.30.0000.00817.61
8.1.20.0060.00317.55
8.1.10.0070.00017.54
8.1.00.0040.00417.47
8.0.300.0000.00718.77
8.0.290.0080.00017.18
8.0.280.0000.00718.43
8.0.270.0000.00717.30
8.0.260.0070.00016.89
8.0.250.0000.00717.08
8.0.240.0000.01016.88
8.0.230.0000.00717.03
8.0.220.0070.00016.96
8.0.210.0000.00817.01
8.0.200.0030.00316.89
8.0.190.0000.00817.06
8.0.180.0040.00416.96
8.0.170.0040.00416.91
8.0.160.0000.00716.82
8.0.150.0040.00416.87
8.0.140.0030.00416.80
8.0.130.0050.00013.26
8.0.120.0070.00016.94
8.0.110.0000.00717.00
8.0.100.0050.00316.88
8.0.90.0040.00416.86
8.0.80.0000.01416.95
8.0.70.0000.00816.91
8.0.60.0050.00216.93
8.0.50.0040.00416.95
8.0.30.0050.01417.24
8.0.20.0090.01417.40
8.0.10.0040.00416.94
8.0.00.0090.01116.74
7.4.330.0000.00515.00
7.4.320.0000.00616.51
7.4.300.0060.00016.64
7.4.290.0030.00316.41
7.4.280.0030.00316.48
7.4.270.0000.00716.56
7.4.260.0040.00413.31
7.4.250.0000.00816.57
7.4.240.0050.00216.52
7.4.230.0030.00316.63
7.4.220.0120.00616.48
7.4.210.0090.00516.63
7.4.200.0040.00416.50
7.4.190.0070.00016.54
7.4.160.0150.00316.60
7.4.150.0110.00717.40
7.4.140.0180.00317.86
7.4.130.0080.00816.59
7.4.120.0100.00816.54
7.4.110.0140.00316.46
7.4.100.0130.01016.39
7.4.90.0110.00716.46
7.4.80.0070.01019.39
7.4.70.0150.00316.68
7.4.60.0100.00616.42
7.4.50.0050.00316.42
7.4.40.0000.01422.77
7.4.30.0100.00616.23
7.4.00.0100.00715.09
7.3.330.0000.00513.26
7.3.320.0050.00013.06
7.3.310.0080.00016.28
7.3.300.0000.00716.26
7.3.290.0100.01016.29
7.3.280.0090.00816.35
7.3.270.0150.00417.40
7.3.260.0100.00716.40
7.3.250.0140.00416.31
7.3.240.0100.00716.57
7.3.230.0140.00316.43
7.3.210.0080.00816.32
7.3.200.0060.01119.39
7.3.190.0160.00716.32
7.3.180.0120.00416.68
7.3.170.0100.00716.48
7.3.160.0050.01316.39
7.3.120.0030.01315.07
7.3.10.0070.01016.76
7.3.00.0060.00916.25
7.2.330.0140.00316.53
7.2.320.0100.01516.41
7.2.310.0100.00716.54
7.2.300.0090.00916.46
7.2.290.0070.01416.59
7.2.130.0070.00716.87
7.2.120.0040.01117.08
7.2.110.0060.00616.92
7.2.100.0060.00616.75
7.2.90.0080.00416.71
7.2.80.0110.00316.85
7.2.70.0060.00316.98
7.2.60.0070.00316.85
7.2.50.0060.00917.04
7.2.40.0040.01116.93
7.2.30.0000.01117.02
7.2.20.0120.00416.69
7.2.10.0060.00916.68
7.2.00.0090.00616.79
7.1.250.0000.01615.91
7.1.70.0040.00417.04
7.1.60.0120.01219.32
7.1.50.0030.02016.95
7.1.00.0030.03322.51
7.0.200.0160.00715.04
7.0.140.0070.06722.18
7.0.100.0070.05020.17
7.0.90.0170.03719.95
7.0.80.0130.04019.91
7.0.70.0200.06720.04
7.0.60.0530.08719.95
7.0.50.0500.08320.37
7.0.40.0100.04720.18
7.0.30.0070.08320.09
7.0.20.0100.08020.19
7.0.10.0070.08020.03
7.0.00.0130.07720.06
5.6.280.0030.07320.81
5.6.250.0030.04720.63
5.6.240.0070.05720.63
5.6.230.0030.04320.63
5.6.220.0030.03720.68
5.6.210.0000.08320.65
5.6.200.0030.08321.05
5.6.190.0000.08321.05
5.6.180.0130.07721.11
5.6.170.0070.08021.09
5.6.160.0100.07721.14
5.6.150.0100.04320.94
5.6.140.0070.05021.07
5.6.130.0070.08021.02
5.6.120.0030.06321.02
5.6.110.0030.05321.00
5.6.100.0100.08321.03
5.6.90.0100.07020.93
5.6.80.0130.04020.32
5.6.70.0200.07020.39
5.6.60.0100.05720.30
5.6.50.0100.06720.46
5.6.40.0000.08720.31
5.6.30.0100.08020.36
5.6.20.0130.06720.38
5.6.10.0100.07720.52
5.6.00.0070.08020.28
5.5.380.0000.04320.42
5.5.370.0000.04720.38
5.5.360.0070.05320.37
5.5.350.0070.07020.38
5.5.340.0130.07020.93
5.5.330.0100.07720.93
5.5.320.0170.06320.83
5.5.310.0000.07320.64
5.5.300.0130.08020.90
5.5.290.0070.08320.81
5.5.280.0070.09020.93
5.5.270.0030.08020.82
5.5.260.0070.08020.75
5.5.250.0100.08020.59
5.5.240.0130.07320.14
5.5.230.0100.08020.27
5.5.220.0130.08020.14
5.5.210.0100.07720.26
5.5.200.0070.07720.28
5.5.190.0100.07720.16
5.5.180.0130.07320.13
5.5.160.0130.07320.18
5.5.150.0130.07320.24
5.5.140.0170.06720.23
5.5.130.0100.07020.11
5.5.120.0130.05320.11
5.5.110.0000.08320.22
5.5.100.0070.04320.08
5.5.90.0070.07720.10
5.5.80.0100.07320.17
5.5.70.0070.07720.04
5.5.60.0030.08720.06
5.5.50.0130.05020.10
5.5.40.0100.07719.96
5.5.30.0100.08020.08
5.5.20.0070.08020.04
5.5.10.0200.05019.98
5.5.00.0130.06019.96
5.4.450.0030.07719.23
5.4.440.0130.07019.27
5.4.430.0070.08019.50
5.4.420.0100.07719.35
5.4.410.0030.04719.38
5.4.400.0070.05019.21
5.4.390.0030.04718.88
5.4.380.0030.08019.18
5.4.370.0070.07719.24
5.4.360.0000.08319.18
5.4.350.0100.06318.90
5.4.340.0030.06718.91
5.4.320.0030.08719.14
5.4.310.0070.07719.03
5.4.300.0130.07019.12
5.4.290.0030.07718.95
5.4.280.0070.08019.04
5.4.270.0030.04018.87
5.4.260.0100.06719.12
5.4.250.0030.08019.23
5.4.240.0070.07019.13
5.4.230.0100.07719.13
5.4.220.0230.06019.20
5.4.210.0070.08019.17
5.4.200.0170.06718.89
5.4.190.0100.06719.13
5.4.180.0070.04319.17
5.4.170.0100.03718.93
5.4.160.0070.06719.14
5.4.150.0030.07319.11
5.4.140.0070.04016.33
5.4.130.0070.06716.30
5.4.120.0100.06316.24
5.4.110.0030.07716.42
5.4.100.0070.07016.44
5.4.90.0000.07016.36
5.4.80.0130.04716.31
5.4.70.0100.04316.43
5.4.60.0070.07016.34
5.4.50.0070.07716.41
5.4.40.0000.08016.53
5.4.30.0070.06716.45
5.4.20.0130.07016.44
5.4.10.0070.05716.41
5.4.00.0100.06715.85
5.3.290.0070.08014.58
5.3.280.0030.07714.54
5.3.270.0030.04314.46
5.3.260.0030.04714.43
5.3.250.0170.06314.57
5.3.240.0170.06014.56
5.3.230.0100.07314.43
5.3.220.0030.07714.55
5.3.210.0070.06714.51
5.3.200.0100.07314.43
5.3.190.0130.06714.48
5.3.180.0000.07714.53
5.3.170.0070.08014.41
5.3.160.0100.07014.55
5.3.150.0030.05714.56
5.3.140.0130.06714.53
5.3.130.0100.07314.48
5.3.120.0030.07714.50
5.3.110.0130.05714.42
5.3.100.0070.06713.90
5.3.90.0070.05313.96
5.3.80.0000.06313.88
5.3.70.0070.06314.03
5.3.60.0170.06714.00
5.3.50.0030.08013.70
5.3.40.0030.04713.72
5.3.30.0030.06713.77
5.3.20.0030.07013.66
5.3.10.0030.07313.66
5.3.00.0000.07713.39
5.2.170.0030.08012.13
5.2.160.0070.03012.13
5.2.150.0030.06312.13
5.2.140.0070.05712.13
5.2.130.0130.05712.13
5.2.120.0070.05012.13
5.2.110.0070.05012.13
5.2.100.0170.04712.13
5.2.90.0030.04312.13
5.2.80.0030.06012.13
5.2.70.0170.05012.13
5.2.60.0130.05712.13
5.2.50.0070.06012.13
5.2.40.0070.06012.13
5.2.30.0000.07012.13
5.2.20.0030.06012.13
5.2.10.0100.05012.13
5.2.00.0030.04312.13
5.1.60.0030.05012.13
5.1.50.0070.05312.13
5.1.40.0030.05012.13
5.1.30.0100.05012.13
5.1.20.0000.05012.13
5.1.10.0000.04712.13
5.1.00.0000.05712.13
5.0.50.0070.04312.13
5.0.40.0070.04012.13
5.0.30.0030.06712.13
5.0.20.0100.03712.13
5.0.10.0030.04712.13
5.0.00.0070.05012.13
4.4.90.0030.03712.13
4.4.80.0070.03312.13
4.4.70.0030.03712.13
4.4.60.0030.03712.13
4.4.50.0000.03712.13
4.4.40.0030.04312.13
4.4.30.0000.03712.13
4.4.20.0030.03712.13
4.4.10.0070.03312.13
4.4.00.0030.05312.13
4.3.110.0000.03712.13
4.3.100.0070.03312.13
4.3.90.0030.03312.13
4.3.80.0000.05312.13
4.3.70.0070.03012.13
4.3.60.0030.03712.13
4.3.50.0030.03012.13
4.3.40.0030.05012.13
4.3.30.0030.03312.13
4.3.20.0030.03312.13
4.3.10.0070.03312.13
4.3.00.0000.03312.13

preferences:
38.71 ms | 401 KiB | 5 Q