3v4l.org

run code in 300+ PHP versions simultaneously
<?php $classmap1 = array(); for ($i=1; $i<=1000; $i++) { $classmap1['a'.$i] = $i+1; } $classmap2 = array(); for ($i=1; $i<=1000; $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.3.10.0110.00416.61
7.3.00.0040.01116.66
7.2.130.0000.01116.77
7.2.120.0070.00716.90
7.2.110.0060.00616.68
7.2.100.0100.00317.05
7.2.90.0120.00616.86
7.2.80.0100.00317.01
7.2.70.0050.00516.68
7.2.60.0070.01017.02
7.2.50.0070.01016.83
7.2.40.0100.00617.03
7.2.30.0070.00316.95
7.2.20.0070.01016.83
7.2.10.0100.00716.67
7.2.00.0010.01218.03
7.1.250.0070.00715.74
7.1.70.0030.00617.20
7.1.60.0070.01819.32
7.1.50.0140.02134.64
7.1.00.0100.05322.44
7.0.200.0000.00716.73
7.0.140.0030.07321.93
7.0.70.3470.05020.11
7.0.60.0070.07020.16
7.0.50.0130.05718.07
7.0.40.0070.04720.25
7.0.30.0330.07320.31
7.0.20.0300.06020.16
7.0.10.0230.08320.09
7.0.00.0000.08020.14
5.6.280.0030.07721.35
5.6.210.0100.08020.97
5.6.200.0100.08318.39
5.6.190.0070.05720.70
5.6.180.0070.07320.66
5.6.170.0230.04320.71
5.6.160.0030.06020.68
5.6.150.0100.07718.44
5.6.140.0030.04718.27
5.6.130.0030.08318.42
5.6.120.0000.07021.30
5.6.110.0070.05021.27
5.6.100.0100.07321.25
5.6.90.0070.04721.26
5.6.80.0170.07320.80
5.6.70.0170.08020.65
5.5.350.0070.07720.69
5.5.340.0170.07018.23
5.5.330.0070.09020.44
5.5.320.0030.05320.32
5.5.310.0230.07320.53
5.5.300.0030.08718.21
5.5.290.0000.04318.05
5.5.280.0000.04720.94
5.5.270.0030.08721.04
5.5.260.0100.07721.07
5.5.250.0200.05020.75
5.5.240.0000.04320.58
5.4.450.0230.07719.48
5.4.440.0200.07319.67
5.4.430.0230.07319.67
5.4.420.0400.06019.76
5.4.410.0300.04019.36
5.4.400.0200.04019.08
5.4.390.0230.08019.20
5.4.380.0230.05319.29
5.4.370.0270.06319.08
5.4.360.0230.05019.46
5.4.350.0270.06719.35
5.4.340.0200.07719.23
5.4.320.0270.07719.30
5.4.310.0200.07319.29
5.4.300.0400.04019.07
5.4.290.0230.05019.21
5.4.280.0230.04719.28
5.4.270.0200.08019.29
5.4.260.0370.06019.14
5.4.250.0270.07719.16
5.4.240.0200.07019.30
5.4.230.0230.07019.56
5.4.220.0230.03319.52
5.4.210.0300.03019.34
5.4.200.0170.06019.21
5.4.190.0270.07319.20
5.4.180.0230.05719.34
5.4.170.0270.07019.53
5.4.160.0330.06319.26
5.4.150.0130.06719.33
5.4.140.0230.07016.61
5.4.130.0200.05316.59
5.4.120.0300.06316.93
5.4.110.0230.07016.82
5.4.100.0300.06716.66
5.4.90.0270.07016.68
5.4.80.0330.05016.44
5.4.70.0300.06716.80
5.4.60.0230.07016.78
5.4.50.0200.06317.00
5.4.40.0300.05316.47
5.4.30.0300.04316.79
5.4.20.0300.07316.69
5.4.10.0170.05316.70
5.4.00.0270.05716.06
5.3.290.0230.07715.16
5.3.280.0230.03715.00
5.3.270.0230.07315.07
5.3.260.0270.05715.02
5.3.250.0430.03015.00
5.3.240.0270.05715.01
5.3.230.0270.06715.24
5.3.220.0200.07315.14
5.3.210.0300.06015.13
5.3.200.0270.06715.17
5.3.190.0270.07715.07
5.3.180.0330.06315.16
5.3.170.0330.04715.03
5.3.160.0200.05714.98
5.3.150.0200.07315.03
5.3.140.0230.07715.12
5.3.130.0230.07714.93
5.3.120.0200.08014.94
5.3.110.0270.07015.01
5.3.100.0200.07014.43
5.3.90.0170.06714.47
5.3.80.0230.06714.58
5.3.70.0200.07714.51
5.3.60.0300.07014.53
5.3.50.0270.07314.35
5.3.40.0230.07314.57
5.3.30.0100.04714.30
5.3.20.0230.07714.09
5.3.10.0270.06714.12
5.3.00.0300.03714.11
5.2.170.0170.05712.46
5.2.160.0170.04012.46
5.2.150.0230.04012.46
5.2.140.0100.03312.46
5.2.130.0170.05712.46
5.2.120.0130.04712.46
5.2.110.0200.05312.46
5.2.100.0130.04712.46
5.2.90.0270.05312.46
5.2.80.0230.04312.46
5.2.70.0170.04312.46
5.2.60.0170.04712.46
5.2.50.0200.05712.46
5.2.40.0230.04712.46
5.2.30.0270.04712.46
5.2.20.0230.04712.46
5.2.10.0170.06012.46
5.2.00.0130.06012.46
5.1.60.0030.05312.46
5.1.50.0100.04712.46
5.1.40.0170.04012.46
5.1.30.0230.03312.46
5.1.20.0130.04012.46
5.1.10.0200.04012.46
5.1.00.0130.05312.46
5.0.50.0100.04012.46
5.0.40.0100.03312.46
5.0.30.0130.05012.46
5.0.20.0070.02012.46
5.0.10.0130.03312.46
5.0.00.0130.05712.46
4.4.90.0030.03312.46
4.4.80.0030.02012.46
4.4.70.0100.03012.46
4.4.60.0200.02712.46
4.4.50.0070.03712.46
4.4.40.0070.05012.46
4.4.30.0070.02312.46
4.4.20.0070.03012.46
4.4.10.0100.03012.46
4.4.00.0130.05012.46
4.3.110.0100.02312.46
4.3.100.0070.02012.46
4.3.90.0030.03312.46
4.3.80.0070.03712.46
4.3.70.0130.03012.46
4.3.60.0130.03012.46
4.3.50.0070.02312.46
4.3.40.0100.05012.46
4.3.30.0100.01712.46
4.3.20.0030.03012.46
4.3.10.0130.02312.46
4.3.00.0030.03012.46

preferences:
30.44 ms | 401 KiB | 5 Q