3v4l.org

run code in 300+ PHP versions simultaneously
<?php $classmap1 = array(); for ($i=1; $i<=15000; $i++) { $classmap1['a'.$i] = $i+1; } $classmap2 = array(); for ($i=1; $i<=15000; $i++) { $classmap2['b'.$i] = $i+1; } abstract class merging { public static function merge(array $a, array $b) { foreach ($b as $key => $value) { if (isset($a[$key])) { if (is_int($key)) { $a[] = $value; } elseif (is_array($value) && is_array($a[$key])) { $a[$key] = static::merge($a[$key], $value); } else { $a[$key] = $value; } } else { $a[$key] = $value; } } return $a; } } $startTimeFunc = microtime(true); merging::merge($classmap1, $classmap2); $endTimeFunc = microtime(true); echo "Func took " . (($endTimeFunc - $startTimeFunc)*1000) ." microseconds<br />\n";

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)
7.2.110.0000.01720.33
7.2.100.0000.01620.61
7.2.90.0090.01220.59
7.2.80.0070.01020.48
7.2.70.0070.00720.67
7.2.60.0000.01820.81
7.2.50.0030.01220.74
7.2.40.0040.01520.72
7.2.30.0060.01320.73
7.2.20.0000.02020.56
7.2.10.0000.01920.81
7.2.00.0110.00822.14
7.1.230.0070.01319.67
7.1.220.0040.00819.63
7.1.210.0030.01419.75
7.1.200.0060.00919.75
7.1.190.0000.01319.43
7.1.180.0060.01219.46
7.1.170.0030.01719.82
7.1.160.0100.00719.64
7.1.150.0070.01419.83
7.1.140.0000.01619.47
7.1.130.0070.01019.67
7.1.120.0080.01119.85
7.1.110.0000.01219.62
7.1.100.0030.01719.65
7.1.90.0030.01419.82
7.1.80.0070.01019.48
7.1.70.0000.01620.38
7.1.60.0070.01520.38
7.1.50.0100.01620.41
7.1.40.0060.01619.46
7.1.30.0100.01019.88
7.1.20.0040.01419.82
7.1.10.0070.01119.78
7.1.00.0050.03223.01
7.0.310.0060.01019.31
7.0.300.0040.01119.26
7.0.290.0090.00619.53
7.0.280.0030.01419.44
7.0.270.0050.00519.54
7.0.260.0030.01319.32
7.0.250.0030.00919.51
7.0.240.0090.00919.51
7.0.230.0100.00319.61
7.0.220.0030.01519.47
7.0.210.0070.00719.57
7.0.200.1140.00819.19
7.0.190.0100.01019.26
7.0.180.0060.01219.27
7.0.170.0000.01719.43
7.0.160.0060.01019.62
7.0.150.0030.01319.50
7.0.140.0070.04322.71
7.0.130.0030.01519.35
7.0.120.0100.00719.43
7.0.110.0060.01219.48
7.0.100.0250.04321.54
7.0.90.0200.03521.43
7.0.80.0120.04621.52
7.0.70.0280.03721.57
7.0.60.0200.04721.42
7.0.50.0270.04321.59
7.0.40.0070.04716.79
7.0.30.0150.02616.81
7.0.20.0100.03516.81
7.0.10.0060.03116.86
7.0.00.0120.03516.71
5.6.380.0100.02023.54
5.6.370.0140.01723.44
5.6.360.0100.02023.66
5.6.350.0090.01823.35
5.6.340.0040.02123.81
5.6.330.0000.02322.98
5.6.320.0130.01923.69
5.6.310.0090.01823.33
5.6.300.0100.01623.68
5.6.290.0100.02323.61
5.6.280.0030.02523.71
5.6.270.0120.01923.54
5.6.260.0190.01223.65
5.6.250.0050.04126.50
5.6.240.0070.04726.59
5.6.230.0120.05926.39
5.6.220.0080.05626.37
5.6.210.0080.06426.48
5.6.200.0180.05926.56
5.6.190.0210.04526.56
5.6.180.0070.06326.78
5.6.170.0080.05726.52
5.6.160.0170.05526.61
5.6.150.0080.04526.70
5.6.140.0100.05526.49
5.6.130.0070.05826.70
5.6.120.0020.04926.61
5.6.110.0150.05026.57
5.6.100.0080.04626.63
5.6.90.0100.05226.66
5.6.80.0120.05126.36
5.6.70.0110.03626.25
5.6.60.0120.05026.17
5.6.50.0130.06026.29
5.6.40.0060.05926.13
5.6.30.0080.05226.33
5.6.20.0130.05326.21
5.6.10.0100.04826.37
5.6.00.0050.06226.21
5.5.380.0050.05924.66
5.5.370.0080.05524.90
5.5.360.0100.06024.71
5.5.350.0070.06324.74
5.5.340.0080.05224.91
5.5.330.0120.05324.88
5.5.320.0130.05724.95
5.5.310.0100.05725.13
5.5.300.0070.05624.89
5.5.290.0120.05524.77
5.5.280.0100.03525.07
5.5.270.0100.05524.71
5.5.260.0120.05025.10
5.5.250.0080.05024.87
5.5.240.0050.04524.52
5.5.230.0130.05524.62
5.5.220.0050.05124.54
5.5.210.0030.04924.69
5.5.200.0080.05824.46
5.5.190.0050.04324.69
5.5.180.0130.05224.57
5.5.170.0100.01923.52
5.5.160.0150.03024.67
5.5.150.0130.04624.42
5.5.140.0080.03524.73
5.5.130.0100.05824.67
5.5.120.0020.04424.52
5.5.110.0100.04824.52
5.5.100.0110.05524.44
5.5.90.0150.04324.39
5.5.80.0100.04624.49
5.5.70.0050.04524.45
5.5.60.0120.05324.60
5.5.50.0150.04824.68
5.5.40.0160.05224.44
5.5.30.0140.04224.40
5.5.20.0050.03624.66
5.5.10.0120.04024.60
5.5.00.0070.04724.35
5.4.450.0070.04324.13
5.4.440.0120.03724.21
5.4.430.0110.03124.15
5.4.420.0120.04124.21
5.4.410.0080.05423.98
5.4.400.0030.04023.98
5.4.390.0120.05123.87
5.4.380.0160.05223.91
5.4.370.0080.05623.90
5.4.360.0020.05624.00
5.4.350.0080.05123.95
5.4.340.0130.05123.92
5.4.330.0100.01920.22
5.4.320.0100.05723.92
5.4.310.0150.04824.10
5.4.300.0130.04423.96
5.4.290.0100.03523.88
5.4.280.0180.05823.88
5.4.270.0080.05023.85
5.4.260.0080.05124.00
5.4.250.0030.06023.95
5.4.240.0070.05223.82
5.4.230.0100.05623.90
5.4.220.0130.05424.11
5.4.210.0100.04623.99
5.4.200.0130.03424.10
5.4.190.0060.04023.92
5.4.180.0100.05723.97
5.4.170.0030.04724.01
5.4.160.0100.05724.09
5.4.150.0070.03323.98
5.4.140.0150.05322.63
5.4.130.0100.03822.51
5.4.120.0130.03622.68
5.4.110.0030.04122.71
5.4.100.0080.04922.60
5.4.90.0070.05322.83
5.4.80.0030.05922.64
5.4.70.0130.03522.84
5.4.60.0070.03222.55
5.4.50.0140.03022.52
5.4.40.0120.03222.66
5.4.30.0060.03222.69
5.4.20.0090.02922.49
5.4.10.0090.03222.67
5.4.00.0080.03322.30
5.3.290.0100.05621.31
5.3.280.0120.05021.19
5.3.270.0100.04221.28
5.3.260.0050.06121.14
5.3.250.0050.04221.23
5.3.240.0100.04821.10
5.3.230.0100.05821.15
5.3.220.0070.06321.15
5.3.210.0120.05321.16
5.3.200.0070.05121.15
5.3.190.0060.04921.16
5.3.180.0080.05621.12
5.3.170.0050.06321.19
5.3.160.0080.03821.15
5.3.150.0070.04121.33
5.3.140.0050.04221.23
5.3.130.0050.03621.18
5.3.120.0030.04321.18
5.3.110.0040.04121.16
5.3.100.0050.03420.86
5.3.90.0080.03521.02
5.3.80.0080.03220.83
5.3.70.0030.03720.73
5.3.60.0080.02720.69
5.3.50.0050.03720.88
5.3.40.0070.03520.80
5.3.30.0030.04120.72
5.3.20.0120.03520.62
5.3.10.0120.03220.37
5.3.00.0090.03120.58
5.2.170.0030.01810.32
5.2.160.0040.01310.27
5.2.150.0030.01810.30
5.2.140.0020.01710.14
5.2.130.0020.01710.29
5.2.120.0050.01210.07
5.2.110.0010.01810.26
5.2.100.0010.01610.15
5.2.90.0050.01310.19
5.2.80.0060.01510.23
5.2.70.0030.01510.12
5.2.60.0050.0139.99
5.2.50.0030.01510.16
5.2.40.0070.01510.19
5.2.30.0020.0189.97
5.2.20.0010.0169.96
5.2.10.0010.0149.86
5.2.00.0020.0189.84
5.1.60.0020.0109.34
5.1.50.0030.0129.31
5.1.40.0000.0179.35
5.1.30.0020.0159.52
5.1.20.0020.0159.50
5.1.10.0040.0109.38
5.1.00.0000.0149.39
5.0.50.0020.0108.60
5.0.40.0020.0118.55
5.0.30.0000.0188.35
5.0.20.0000.0118.36
5.0.10.0020.0108.44
5.0.00.0020.0138.40
4.4.90.0000.0108.23
4.4.80.0020.0088.23
4.4.70.0030.0068.23
4.4.60.0020.0098.23
4.4.50.0030.0088.23
4.4.40.0000.0138.23
4.4.30.0000.0088.23
4.4.20.0010.0098.23
4.4.10.0020.0078.23
4.4.00.0000.0188.23
4.3.110.0020.0078.23
4.3.100.0020.0088.23
4.3.90.0000.0098.23
4.3.80.0010.0138.23
4.3.70.0010.0078.23
4.3.60.0000.0108.23
4.3.50.0000.0108.23
4.3.40.0000.0148.23
4.3.30.0000.0108.23
4.3.20.0030.0078.23
4.3.10.0030.0078.23
4.3.00.0030.0068.23

preferences:
40.42 ms | 400 KiB | 5 Q