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 (array_key_exists($key, $a)) { 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.4.00.0070.02318.56
7.3.120.0120.01618.83
7.3.110.0070.02119.11
7.3.100.0070.01818.84
7.3.90.0060.01218.81
7.3.80.0070.01718.85
7.3.70.0040.01818.85
7.3.60.0130.00318.72
7.3.50.0100.01018.86
7.3.40.0040.01818.61
7.3.30.0030.01718.71
7.3.20.0000.02220.71
7.3.10.0090.01220.71
7.3.00.0000.01920.63
7.2.250.0030.02818.70
7.2.240.0160.01318.23
7.2.230.0070.01818.46
7.2.220.0070.01418.86
7.2.210.0030.01718.54
7.2.200.0110.01418.70
7.2.190.0130.01018.55
7.2.180.0060.01618.72
7.2.170.0070.01718.61
7.2.160.0060.01618.82
7.2.150.0100.01020.84
7.2.140.0060.01320.86
7.2.130.0100.01420.90
7.2.120.0030.01620.86
7.2.110.0030.01920.84
7.2.100.0030.02020.80
7.2.90.0060.01320.91
7.2.80.0060.01620.85
7.2.70.0100.01021.03
7.2.60.0030.02021.00
7.2.50.0060.01620.93
7.2.40.0030.01720.77
7.2.30.0000.02220.91
7.2.20.0080.01120.92
7.2.10.0080.00820.88
7.2.00.0060.01421.88
7.1.330.0100.01919.85
7.1.320.0100.01319.66
7.1.310.0070.02019.73
7.1.300.0060.01619.82
7.1.290.0030.02119.53
7.1.280.0000.01719.48
7.1.270.0100.01319.61
7.1.260.0110.01519.89
7.1.250.0030.01619.82
7.1.240.0030.02019.41
7.1.230.0100.01419.82
7.1.220.0030.01719.87
7.1.210.0070.01319.57
7.1.200.0070.01319.81
7.1.190.0090.01219.70
7.1.180.0030.02019.77
7.1.170.0030.01419.89
7.1.160.0000.02219.68
7.1.150.0030.02119.54
7.1.140.0030.01419.81
7.1.130.0000.01819.78
7.1.120.0040.01819.63
7.1.110.0100.01419.80
7.1.100.0040.01819.88
7.1.90.0090.01319.45
7.1.80.0030.02019.84
7.1.70.0090.00820.31
7.1.60.0000.01720.50
7.1.50.0090.01920.30
7.1.40.0000.02119.65
7.1.30.0070.01719.55
7.1.20.0000.02519.89
7.1.10.0110.01419.59
7.1.00.0020.03222.82
7.0.330.0090.00919.38
7.0.320.0030.01919.25
7.0.310.0110.01119.21
7.0.300.0030.01719.45
7.0.290.0000.02619.43
7.0.280.0000.01919.17
7.0.270.0000.02119.45
7.0.260.0030.02119.32
7.0.250.0090.00919.43
7.0.240.0030.01819.53
7.0.230.0070.01819.07
7.0.220.0070.01719.24
7.0.210.0070.01519.58
7.0.200.0850.00819.14
7.0.190.0060.01619.35
7.0.180.0070.01719.44
7.0.170.0040.02219.45
7.0.160.0100.01419.49
7.0.150.0040.01519.26
7.0.140.0120.04422.58
7.0.130.0060.01519.52
7.0.120.0000.02519.23
7.0.110.0100.01319.43
7.0.100.0160.05121.53
7.0.90.0170.05221.40
7.0.80.0050.04821.50
7.0.70.0120.03821.45
7.0.60.0130.05021.46
7.0.50.0070.05321.65
7.0.40.0100.04816.89
7.0.30.0030.05216.74
7.0.20.0100.04416.80
7.0.10.0020.04316.86
7.0.00.0100.03916.78
5.6.400.0130.02823.61
5.6.390.0060.02923.48
5.6.380.0130.02823.77
5.6.370.0000.03923.77
5.6.360.0100.02323.52
5.6.350.0060.03223.60
5.6.340.0100.02423.29
5.6.330.0070.03323.27
5.6.320.0030.03623.34
5.6.310.0030.03023.40
5.6.300.0030.03723.60
5.6.290.0200.02623.57
5.6.280.0140.05826.55
5.6.270.0040.03923.29
5.6.260.0070.03223.62
5.6.250.0050.06626.49
5.6.240.0080.06726.52
5.6.230.0160.04926.52
5.6.220.0170.06326.45
5.6.210.0080.06026.54
5.6.200.0120.06526.62
5.6.190.0170.06226.68
5.6.180.0100.07126.73
5.6.170.0100.06526.79
5.6.160.0100.06526.59
5.6.150.0100.06726.59
5.6.140.0100.06726.56
5.6.130.0120.06126.64
5.6.120.0120.06626.62
5.6.110.0080.06126.68
5.6.100.0090.07126.63
5.6.90.0150.06526.68
5.6.80.0200.05026.30
5.6.70.0100.06126.51
5.6.60.0120.06226.27
5.6.50.0100.05726.29
5.6.40.0080.05326.30
5.6.30.0200.05526.24
5.6.20.0150.06226.21
5.6.10.0080.06426.41
5.6.00.0100.05426.31
5.5.380.0110.07026.40
5.5.370.0070.05726.16
5.5.360.0150.05926.34
5.5.350.0050.06826.23
5.5.340.0050.06926.36
5.5.330.0030.07726.29
5.5.320.0180.06326.33
5.5.310.0130.04126.63
5.5.300.0130.06726.49
5.5.290.0090.07026.39
5.5.280.0240.05926.49
5.5.270.0190.06826.28
5.5.260.0070.06326.68
5.5.250.0100.07026.31
5.5.240.0180.05126.07
5.5.230.0100.06326.26
5.5.220.0050.06226.00
5.5.210.0180.06026.13
5.5.200.0140.06226.00
5.5.190.0120.06526.10
5.5.180.0080.06226.21
5.5.170.0000.03623.22
5.5.160.0100.06526.04
5.5.150.0100.06026.21
5.5.140.0100.03726.22
5.5.130.0080.04026.14
5.5.120.0030.04526.08
5.5.110.0080.04126.13
5.5.100.0070.04226.20
5.5.90.0100.06826.18
5.5.80.0210.05526.14
5.5.70.0050.06426.18
5.5.60.0120.03526.04
5.5.50.0070.04325.96
5.5.40.0070.05826.17
5.5.30.0120.03725.80
5.5.20.0120.04225.95
5.5.10.0080.04525.99
5.5.00.0080.05726.06
5.4.450.0070.06724.19
5.4.440.0100.06024.11
5.4.430.0150.06024.05
5.4.420.0120.05324.09
5.4.410.0120.06124.24
5.4.400.0130.05723.85
5.4.390.0180.05523.99
5.4.380.0140.06123.75
5.4.370.0130.06024.04
5.4.360.0120.05923.90
5.4.350.0070.05224.02
5.4.340.0130.05724.16
5.4.330.0000.03319.99
5.4.320.0120.04324.01
5.4.310.0050.04924.05
5.4.300.0030.04523.93
5.4.290.0080.04123.91
5.4.280.0100.03923.97
5.4.270.0100.03824.06
5.4.260.0100.03723.88
5.4.250.0070.04423.93
5.4.240.0120.05923.84
5.4.230.0130.03823.94
5.4.220.0120.04723.98
5.4.210.0120.03823.83
5.4.200.0070.04123.99
5.4.190.0070.05123.97
5.4.180.0110.05123.81
5.4.170.0030.04123.98
5.4.160.0080.03823.87
5.4.150.0080.03823.92
5.4.140.0130.02922.64
5.4.130.0050.05422.59
5.4.120.0080.03822.64
5.4.110.0080.03822.67
5.4.100.0130.04622.69
5.4.90.0070.03822.54
5.4.80.0050.04122.66
5.4.70.0050.04322.66
5.4.60.0180.03122.55
5.4.50.0170.03522.60
5.4.40.0080.04122.62
5.4.30.0080.03722.71
5.4.20.0130.05422.67
5.4.10.0180.05322.58
5.4.00.0080.06322.36
5.3.290.0120.03921.16
5.3.280.0050.06821.18
5.3.270.0130.04221.25
5.3.260.0050.06621.22
5.3.250.0070.04321.08
5.3.240.0080.04021.20
5.3.230.0080.03921.19
5.3.220.0070.04321.06
5.3.210.0050.04421.01
5.3.200.0030.04721.20
5.3.190.0050.03921.24
5.3.180.0020.06321.31
5.3.170.0050.04421.12
5.3.160.0100.03721.26
5.3.150.0070.06021.29
5.3.140.0070.04621.21
5.3.130.0120.05521.24
5.3.120.0050.06921.07
5.3.110.0080.04921.27
5.3.100.0130.05520.95
5.3.90.0100.06920.96
5.3.80.0070.07020.81
5.3.70.0180.03820.85
5.3.60.0100.05920.80
5.3.50.0100.06220.84
5.3.40.0100.06820.76
5.3.30.0080.05920.63
5.3.20.0080.06120.60
5.3.10.0080.06420.44
5.3.00.0070.06520.52
5.2.170.0070.06014.12
5.2.160.0100.05314.12
5.2.150.0030.06014.12
5.2.140.0070.06314.12
5.2.130.0070.05314.12
5.2.120.0070.04314.12
5.2.110.0030.05714.12
5.2.100.0100.04714.12
5.2.90.0130.05314.12
5.2.80.0100.05314.12
5.2.70.0100.05714.12
5.2.60.0100.06014.12
5.2.50.0130.05314.12
5.2.40.0070.06014.12
5.2.30.0100.05014.12
5.2.20.0070.05714.12
5.2.10.0100.05714.12
5.2.00.0030.06314.12
5.1.60.0030.04714.12
5.1.50.0030.05714.12
5.1.40.0130.04714.12
5.1.30.0030.06014.12
5.1.20.0030.06314.12
5.1.10.0070.05314.12
5.1.00.0100.05014.12
5.0.50.0000.05014.12
5.0.40.0030.04314.12
5.0.30.0070.06314.12
5.0.20.0070.02714.12
5.0.10.0130.02314.12
5.0.00.0070.06314.12
4.4.90.0070.03314.12
4.4.80.0070.03314.12
4.4.70.0070.03314.12
4.4.60.0030.03314.12
4.4.50.0070.03314.12
4.4.40.0030.05014.12
4.4.30.0070.03314.12
4.4.20.0030.03314.12
4.4.10.0000.03014.12
4.4.00.0000.06014.12
4.3.110.0070.03314.12
4.3.100.0100.02714.12
4.3.90.0000.03714.12
4.3.80.0030.05014.12
4.3.70.0000.03314.12
4.3.60.0070.03014.12
4.3.50.0030.03314.12
4.3.40.0030.05014.12
4.3.30.0030.03314.12
4.3.20.0030.03314.12
4.3.10.0030.03314.12
4.3.00.0000.03014.12

preferences:
31.66 ms | 401 KiB | 5 Q