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.4.10.0040.02218.83
7.4.00.0100.01018.81
7.3.130.0130.01718.91
7.3.120.0130.01618.86
7.3.110.0090.02118.71
7.3.100.0090.00918.60
7.3.90.0130.00918.82
7.3.80.0110.00818.76
7.3.70.0100.01018.79
7.3.60.0100.01318.85
7.3.50.0070.01718.95
7.3.40.0130.01018.56
7.3.30.0130.00718.70
7.3.20.0150.00620.46
7.3.10.0090.01520.79
7.3.00.0070.01020.39
7.2.260.0100.01918.63
7.2.250.0140.01418.77
7.2.240.0100.01418.82
7.2.230.0070.01718.80
7.2.220.0040.01818.64
7.2.210.0100.01018.48
7.2.200.0060.01518.34
7.2.190.0030.02218.58
7.2.180.0140.00718.64
7.2.170.0030.01618.71
7.2.160.0000.02218.46
7.2.150.0070.01520.89
7.2.140.0100.01020.79
7.2.130.0030.01720.88
7.2.120.0040.01420.63
7.2.110.0100.01020.65
7.2.100.0000.02220.95
7.2.90.0060.01020.87
7.2.80.0000.01820.73
7.2.70.0030.01920.93
7.2.60.0030.01420.84
7.2.50.0030.02020.69
7.2.40.0130.01020.99
7.2.30.0130.00720.92
7.2.20.0070.01720.96
7.2.10.0030.01720.90
7.2.00.0050.01121.91
7.1.330.0130.01019.68
7.1.320.0100.01319.82
7.1.310.0030.01719.58
7.1.300.0110.01119.78
7.1.290.0000.01619.68
7.1.280.0070.01119.62
7.1.270.0060.01519.71
7.1.260.0130.01019.54
7.1.250.0040.01819.70
7.1.240.0000.02119.70
7.1.230.0060.01519.71
7.1.220.0070.01619.44
7.1.210.0070.01719.75
7.1.200.0100.01319.56
7.1.190.0040.01519.77
7.1.180.0040.01819.70
7.1.170.0000.01819.72
7.1.160.0070.01419.50
7.1.150.0060.01219.70
7.1.140.0100.01019.57
7.1.130.0100.01319.89
7.1.120.0030.01619.70
7.1.110.0060.01619.69
7.1.100.0160.00719.68
7.1.90.0000.01919.41
7.1.80.0140.01019.61
7.1.70.0040.01220.29
7.1.60.0060.02220.29
7.1.50.0050.02120.31
7.1.40.0060.01019.90
7.1.30.0110.01119.78
7.1.20.0100.01319.81
7.1.10.0040.01419.57
7.1.00.0050.05022.90
7.0.330.0100.01419.32
7.0.320.0090.01219.45
7.0.310.0070.01019.19
7.0.300.0070.01119.15
7.0.290.0040.01519.34
7.0.280.0100.01419.43
7.0.270.0040.01919.34
7.0.260.0180.00319.52
7.0.250.0120.00919.49
7.0.240.0100.01019.22
7.0.230.0130.01019.47
7.0.220.0000.01919.38
7.0.210.0000.02219.59
7.0.200.0050.01220.05
7.0.190.0030.01419.19
7.0.180.0150.00919.41
7.0.170.0040.01519.48
7.0.160.0130.01019.44
7.0.150.0060.01619.62
7.0.140.0060.04422.81
7.0.130.0120.00919.44
7.0.120.0070.01419.27
7.0.110.0070.01719.16
7.0.100.0030.02019.42
7.0.90.0180.05021.55
7.0.80.0060.04921.38
7.0.70.0400.04521.44
7.0.60.0240.04521.58
7.0.50.0270.05121.81
7.0.40.0080.04116.63
7.0.30.0070.06016.82
7.0.20.0050.03416.77
7.0.10.0080.04816.82
7.0.00.0080.04916.76
5.6.400.0130.02322.14
5.6.390.0100.02422.00
5.6.380.0160.02222.05
5.6.370.0100.02621.70
5.6.360.0100.02722.07
5.6.350.0140.02521.69
5.6.340.0060.02622.06
5.6.330.0100.02822.34
5.6.320.0130.02521.57
5.6.310.0100.02722.03
5.6.300.0030.02921.93
5.6.290.0170.02321.92
5.6.280.0080.05825.01
5.6.270.0030.03021.91
5.6.260.0130.02021.86
5.6.250.0070.03021.84
5.6.240.0100.03122.04
5.6.230.0170.05625.16
5.6.220.0050.05825.13
5.6.210.0070.04625.12
5.6.200.0120.05025.24
5.6.190.0100.06325.20
5.6.180.0030.04825.18
5.6.170.0100.05525.21
5.6.160.0070.06925.33
5.6.150.0070.04225.27
5.6.140.0080.06225.12
5.6.130.0070.06825.20
5.6.120.0130.04425.22
5.6.110.0180.03825.08
5.6.100.0170.03525.22
5.6.90.0080.06025.23
5.6.80.0060.06324.80
5.6.70.0110.04124.78
5.6.60.0100.04924.81
5.6.50.0030.05825.00
5.6.40.0130.06024.81
5.6.30.0050.04724.79
5.6.20.0050.05524.96
5.6.10.0050.05724.86
5.6.00.0110.04624.90
5.5.380.0060.03221.88
5.5.370.0070.04425.09
5.5.360.0120.06224.75
5.5.350.0070.04525.03
5.5.340.0050.06024.91
5.5.330.0180.05625.01
5.5.320.0120.05425.00
5.5.310.0070.06725.22
5.5.300.0130.05725.03
5.5.290.0130.05025.04
5.5.280.0030.05424.99
5.5.270.0100.04425.06
5.5.260.0070.04325.00
5.5.250.0080.06324.98
5.5.240.0120.06024.76
5.5.230.0120.05624.86
5.5.220.0120.06524.61
5.5.210.0160.03124.66
5.5.200.0080.05124.80
5.5.190.0070.03924.75
5.5.180.0130.05024.74
5.5.170.0190.02321.54
5.5.160.0100.04924.60
5.5.150.0030.04924.62
5.5.140.0100.03824.82
5.5.130.0050.05324.83
5.5.120.0050.04324.69
5.5.110.0060.04124.83
5.5.100.0050.03824.62
5.5.90.0110.05624.77
5.5.80.0020.04524.78
5.5.70.0120.04124.74
5.5.60.0100.04324.69
5.5.50.0080.04424.75
5.5.40.0120.05524.64
5.5.30.0100.03524.47
5.5.20.0140.04624.65
5.5.10.0060.03824.59
5.5.00.0130.03424.56
5.4.450.0110.05922.55
5.4.440.0030.05922.70
5.4.430.0050.04522.65
5.4.420.0150.04822.75
5.4.410.0050.05822.68
5.4.400.0080.05222.52
5.4.390.0050.05322.39
5.4.380.0070.05722.56
5.4.370.0120.03722.58
5.4.360.0080.05622.54
5.4.350.0050.05222.70
5.4.340.0080.05722.56
5.4.330.0090.02218.65
5.4.320.0080.05922.58
5.4.310.0100.04822.41
5.4.300.0130.03322.37
5.4.290.0030.06322.31
5.4.280.0080.04022.53
5.4.270.0080.03222.46
5.4.260.0100.03722.46
5.4.250.0030.04722.58
5.4.240.0120.05322.26
5.4.230.0120.04522.40
5.4.220.0080.03722.60
5.4.210.0030.04122.48
5.4.200.0070.03722.41
5.4.190.0100.03522.41
5.4.180.0100.03822.50
5.4.170.0060.03822.40
5.4.160.0050.06422.39
5.4.150.0030.04722.49
5.4.140.0030.05721.33
5.4.130.0070.04021.20
5.4.120.0080.04121.20
5.4.110.0110.03321.04
5.4.100.0020.04221.12
5.4.90.0080.03821.19
5.4.80.0080.05321.14
5.4.70.0180.05921.05
5.4.60.0070.05421.14
5.4.50.0120.05421.21
5.4.40.0130.05321.22
5.4.30.0120.03821.22
5.4.20.0070.04321.01
5.4.10.0120.05521.08
5.4.00.0080.04220.84
5.3.290.0150.04919.72
5.3.280.0070.04019.58
5.3.270.0050.04019.64
5.3.260.0070.04319.62
5.3.250.0110.04919.62
5.3.240.0050.04419.51
5.3.230.0120.03819.48
5.3.220.0050.04219.64
5.3.210.0050.04019.63
5.3.200.0150.03219.50
5.3.190.0050.04819.69
5.3.180.0090.04619.71
5.3.170.0050.05819.68
5.3.160.0100.04119.76
5.3.150.0100.06119.65
5.3.140.0050.06219.65
5.3.130.0130.06019.67
5.3.120.0080.05719.63
5.3.110.0130.05719.55
5.3.100.0050.05719.36
5.3.90.0150.05219.24
5.3.80.0020.04819.28
5.3.70.0150.04119.24
5.3.60.0080.04919.21
5.3.50.0020.06419.23
5.3.40.0120.03819.40
5.3.30.0120.04219.26
5.3.20.0050.04818.97
5.3.10.0080.04619.02
5.3.00.0070.04218.96
5.2.170.0070.06013.57
5.2.160.0030.06313.57
5.2.150.0070.05313.57
5.2.140.0100.04713.57
5.2.130.0070.05713.57
5.2.120.0100.03313.57
5.2.110.0070.03313.57
5.2.100.0070.03313.57
5.2.90.0030.03313.57
5.2.80.0070.06013.57
5.2.70.0030.03713.57
5.2.60.0030.06013.57
5.2.50.0030.06313.57
5.2.40.0100.05313.57
5.2.30.0030.04013.57
5.2.20.0100.02013.57
5.2.10.0100.04013.57
5.2.00.0070.03313.57
5.1.60.0000.04313.57
5.1.50.0070.04313.57
5.1.40.0000.05713.57
5.1.30.0100.05313.57
5.1.20.0030.05313.57
5.1.10.0000.05713.57
5.1.00.0130.02013.57
5.0.50.0000.04713.57
5.0.40.0000.03013.57
5.0.30.0070.06713.57
5.0.20.0000.04313.57
5.0.10.0000.02313.57
5.0.00.0000.03713.57
4.4.90.0030.03313.57
4.4.80.0070.01313.57
4.4.70.0000.03013.57
4.4.60.0030.02313.57
4.4.50.0000.03313.57
4.4.40.0000.03013.57
4.4.30.0000.03013.57
4.4.20.0000.02713.57
4.4.10.0070.03013.57
4.4.00.0070.02013.57
4.3.110.0000.02313.57
4.3.100.0030.01713.57
4.3.90.0030.03013.57
4.3.80.0030.04313.57
4.3.70.0030.02713.57
4.3.60.0030.03013.57
4.3.50.0000.02313.57
4.3.40.0030.05313.57
4.3.30.0030.02313.57
4.3.20.0000.02013.57
4.3.10.0000.03013.57
4.3.00.0000.02013.57

preferences:
40.58 ms | 401 KiB | 5 Q