3v4l.org

run code in 300+ PHP versions simultaneously
<?php $classmap1 = array(); for ($i=1; $i<=5000; $i++) { $classmap1['a'.$i] = $i+1; } $classmap2 = array(); for ($i=1; $i<=5000; $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]) || 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.3.10.0090.00918.74
7.3.00.0070.01118.68
7.2.130.0030.01018.88
7.2.120.0100.01018.86
7.2.110.0070.01119.02
7.2.100.0030.01318.75
7.2.90.0090.00618.90
7.2.80.0040.01518.59
7.2.70.0100.00718.86
7.2.60.0070.01118.96
7.2.50.0070.01018.86
7.2.40.0100.00718.57
7.2.30.0090.00618.97
7.2.20.0030.01218.72
7.2.10.0090.00918.63
7.2.00.0050.01020.12
7.1.250.0090.00917.83
7.1.240.0030.01317.68
7.1.230.0030.01017.83
7.1.220.0000.01517.68
7.1.210.0030.01017.80
7.1.200.0060.01317.96
7.1.190.0030.01417.57
7.1.180.0070.01017.74
7.1.170.0100.01317.75
7.1.160.0060.00817.58
7.1.150.0030.01017.83
7.1.140.0100.01017.59
7.1.130.0070.01017.73
7.1.120.0100.00717.62
7.1.110.0060.00917.63
7.1.100.0100.00717.83
7.1.90.0070.01017.89
7.1.80.0060.01317.62
7.1.70.0050.01218.41
7.1.60.0130.00818.55
7.1.50.0030.01218.34
7.1.40.0120.01217.61
7.1.30.0060.01217.95
7.1.20.0100.01417.32
7.1.10.0030.01317.86
7.1.00.0070.04120.91
7.0.330.0130.00717.32
7.0.320.0060.01317.21
7.0.310.0130.01017.25
7.0.300.0060.01317.04
7.0.290.0060.01017.19
7.0.280.0030.00817.25
7.0.270.0070.00717.29
7.0.260.0030.01617.50
7.0.250.0000.01217.16
7.0.240.0100.00717.30
7.0.230.0070.01317.46
7.0.220.0060.01217.21
7.0.210.0070.01017.35
7.0.200.0100.00317.99
7.0.190.0060.01317.43
7.0.180.0090.00617.42
7.0.170.0070.00717.26
7.0.160.0090.01217.54
7.0.150.0030.01617.45
7.0.140.0030.04320.61
7.0.130.0070.01117.53
7.0.120.0030.00917.34
7.0.110.0030.01317.43
7.0.100.0220.02319.29
7.0.90.0170.04219.26
7.0.80.0120.02819.40
7.0.70.0130.04219.39
7.0.60.0150.02519.33
7.0.50.0230.02519.54
7.0.40.0050.02316.85
7.0.30.0150.03516.68
7.0.20.0180.04316.57
7.0.10.0130.04016.79
7.0.00.0080.04416.65
5.6.380.0130.01317.01
5.6.370.0100.01317.32
5.6.360.0030.02316.91
5.6.350.0130.01016.93
5.6.340.0110.01416.63
5.6.330.0030.01916.92
5.6.320.0040.01816.83
5.6.310.0100.01316.90
5.6.300.0070.01816.86
5.6.290.0070.01416.84
5.6.280.0110.04520.25
5.6.270.0130.01017.18
5.6.260.0030.01717.07
5.6.250.0020.05020.12
5.6.240.0080.02920.00
5.6.230.0070.02720.16
5.6.220.0100.04320.02
5.6.210.0100.03020.21
5.6.200.0070.03720.21
5.6.190.0070.04320.28
5.6.180.0080.05420.27
5.6.170.0070.05020.22
5.6.160.0100.04820.36
5.6.150.0140.04620.33
5.6.140.0080.05120.34
5.6.130.0110.04920.22
5.6.120.0100.04720.26
5.6.110.0090.03420.10
5.6.100.0130.04020.09
5.6.90.0120.05020.39
5.6.80.0050.04620.13
5.6.70.0050.05319.95
5.6.60.0080.05019.83
5.6.50.0070.05020.07
5.6.40.0020.05019.76
5.6.30.0100.05119.93
5.6.20.0130.04619.87
5.6.10.0070.03520.06
5.6.00.0080.05019.97
5.5.380.0020.04218.36
5.5.370.0080.03318.46
5.5.360.0080.02818.45
5.5.350.0050.03318.44
5.5.340.0020.03418.46
5.5.330.0060.02618.39
5.5.320.0080.05618.61
5.5.310.0150.04618.68
5.5.300.0170.03518.69
5.5.290.0120.05018.71
5.5.280.0030.06018.75
5.5.270.0070.05218.54
5.5.260.0100.05018.65
5.5.250.0140.04218.37
5.5.240.0070.05018.18
5.5.230.0070.04718.22
5.5.220.0020.05218.25
5.5.210.0100.04518.17
5.5.200.0120.04018.28
5.5.190.0110.04518.04
5.5.180.0100.05018.24
5.5.170.0070.01713.26
5.5.160.0050.05118.29
5.5.150.0080.04718.28
5.5.140.0130.04218.34
5.5.130.0100.04318.16
5.5.120.0020.03818.22
5.5.110.0090.04718.26
5.5.100.0070.03318.12
5.5.90.0100.04418.26
5.5.80.0110.04418.09
5.5.70.0120.04318.11
5.5.60.0130.04418.26
5.5.50.0070.03018.05
5.5.40.0080.05218.12
5.5.30.0100.04318.19
5.5.20.0070.05218.12
5.5.10.0040.04418.21
5.5.00.0100.05218.20
5.4.450.0090.05317.90
5.4.440.0030.05817.76
5.4.430.0120.04317.78
5.4.420.0070.05117.79
5.4.410.0120.04817.68
5.4.400.0100.04317.58
5.4.390.0080.04717.63
5.4.380.0070.04217.57
5.4.370.0070.04717.71
5.4.360.0110.04517.51
5.4.350.0070.04717.80
5.4.340.0070.05217.76
5.4.330.0060.01513.76
5.4.320.0050.05117.53
5.4.310.0100.04817.67
5.4.300.0020.05217.46
5.4.290.0080.04817.69
5.4.280.0050.05017.71
5.4.270.0120.04217.53
5.4.260.0100.04317.52
5.4.250.0030.04917.44
5.4.240.0100.04417.73
5.4.230.0070.05017.45
5.4.220.0050.04917.47
5.4.210.0080.04617.68
5.4.200.0050.04417.61
5.4.190.0050.04917.44
5.4.180.0080.04617.69
5.4.170.0070.04717.40
5.4.160.0080.05117.65
5.4.150.0050.05117.54
5.4.140.0050.03516.28
5.4.130.0100.04116.29
5.4.120.0130.03816.37
5.4.110.0050.03316.44
5.4.100.0080.04016.23
5.4.90.0100.04416.37
5.4.80.0080.04816.31
5.4.70.0080.04916.35
5.4.60.0090.04616.23
5.4.50.0070.04616.15
5.4.40.0090.04216.31
5.4.30.0190.03916.36
5.4.20.0070.04816.22
5.4.10.0080.04016.35
5.4.00.0100.03916.00
5.3.290.0100.05014.90
5.3.280.0080.03614.58
5.3.270.0080.04814.76
5.3.260.0030.04514.79
5.3.250.0050.04914.67
5.3.240.0060.04814.73
5.3.230.0140.03914.77
5.3.220.0080.04514.54
5.3.210.0100.02814.71
5.3.200.0080.05014.72
5.3.190.0080.04314.71
5.3.180.0100.04414.86
5.3.170.0100.04314.76
5.3.160.0080.04714.81
5.3.150.0050.05014.75
5.3.140.0030.05414.74
5.3.130.0070.04814.67
5.3.120.0080.05114.80
5.3.110.0070.05114.80
5.3.100.0050.04514.40
5.3.90.0050.05114.57
5.3.80.0120.04214.25
5.3.70.0050.05214.36
5.3.60.0110.04314.27
5.3.50.0120.04314.57
5.3.40.0130.04314.31
5.3.30.0090.03114.31
5.3.20.0080.04914.33
5.3.10.0050.04314.10
5.3.00.0030.04914.15
5.2.170.0100.03110.77
5.2.160.0020.03410.77
5.2.150.0020.03710.77
5.2.140.0030.03610.77
5.2.130.0030.03010.77
5.2.120.0070.03010.77
5.2.110.0070.03210.77
5.2.100.0070.03310.77
5.2.90.0020.03610.77
5.2.80.0040.03310.77
5.2.70.0070.03210.77
5.2.60.0030.03410.77
5.2.50.0080.03110.77
5.2.40.0020.03610.77
5.2.30.0050.03110.77
5.2.20.0030.03110.77
5.2.10.0010.03110.77
5.2.00.0050.03010.77
5.1.60.0010.02810.77
5.1.50.0060.02310.77
5.1.40.0030.02510.77
5.1.30.0020.02910.77
5.1.20.0020.03010.77
5.1.10.0020.02210.77
5.1.00.0020.03110.77
5.0.50.0050.02510.77
5.0.40.0030.02410.77
5.0.30.0030.03310.77
5.0.20.0000.02610.77
5.0.10.0050.02210.77
5.0.00.0000.03510.77
4.4.90.0000.02010.77
4.4.80.0010.01610.77
4.4.70.0030.02010.77
4.4.60.0050.01910.77
4.4.50.0050.01710.77
4.4.40.0020.02810.77
4.4.30.0020.01910.77
4.4.20.0020.01710.77
4.4.10.0040.01810.77
4.4.00.0000.03210.77
4.3.110.0020.02010.77
4.3.100.0050.01710.77
4.3.90.0020.02010.77
4.3.80.0050.02710.77
4.3.70.0070.01510.77
4.3.60.0050.01710.77
4.3.50.0000.02010.77
4.3.40.0000.02510.77
4.3.30.0040.01810.77
4.3.20.0020.02010.77
4.3.10.0000.02210.77
4.3.00.0050.01710.77

preferences:
45.18 ms | 401 KiB | 5 Q