3v4l.org

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

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.0030.02218.01
7.3.120.0090.01517.62
7.3.110.0070.01417.69
7.3.100.0030.01217.89
7.3.90.0100.01017.53
7.3.80.0040.01417.89
7.3.70.0040.01817.90
7.3.60.0040.01817.93
7.3.50.0130.00917.91
7.3.40.0060.01317.75
7.3.30.0090.01018.07
7.3.20.0060.01220.60
7.3.10.0000.01620.46
7.3.00.0060.01220.41
7.2.250.0100.01717.92
7.2.240.0100.01617.52
7.2.230.0030.01517.54
7.2.220.0130.00717.67
7.2.210.0040.01817.90
7.2.200.0030.01617.75
7.2.190.0070.01017.46
7.2.180.0130.00617.69
7.2.170.0070.01317.79
7.2.00.0070.01421.13
7.1.330.0000.02117.71
7.1.320.0100.01317.67
7.1.310.0100.01017.47
7.1.300.0060.01317.46
7.1.290.0030.01317.80
7.1.280.0070.01417.70
7.1.270.0030.01317.61
7.1.260.0060.01217.37
7.1.70.0030.00619.12
7.1.60.0100.02019.32
7.1.50.0140.02836.88
7.1.00.0030.06324.24
7.0.200.0040.00718.80
7.0.140.0030.07723.99
7.0.70.0070.08023.73
7.0.60.0030.06723.69
7.0.50.0070.07324.11
7.0.40.0100.08720.14
7.0.30.0100.08320.11
7.0.20.0070.06320.08
7.0.10.0030.07720.04
7.0.00.0030.09319.99
5.6.280.0070.08324.77
5.6.220.0030.08724.36
5.6.210.0070.08724.47
5.6.200.0070.09324.88
5.6.190.0100.09024.88
5.6.180.0100.09324.89
5.6.170.0070.09324.93
5.6.160.0170.08724.80
5.6.150.0030.10024.82
5.6.140.0200.07724.88
5.6.130.0070.08325.00
5.6.120.0070.05325.03
5.6.110.0070.09324.86
5.6.100.0030.05325.02
5.6.90.0000.09324.86
5.6.80.0070.07324.30
5.6.70.0130.08324.35
5.6.60.0030.09024.34
5.6.50.0170.08024.32
5.6.40.0100.07024.18
5.6.30.0130.08324.33
5.6.20.0100.08724.29
5.6.10.0100.09024.28
5.6.00.0070.09324.22
5.5.360.0100.09024.42
5.5.350.0170.08724.32
5.5.340.0100.09724.72
5.5.330.0170.05724.75
5.5.320.0070.09024.69
5.5.310.0100.06724.70
5.5.300.0100.08324.77
5.5.290.0100.08724.77
5.5.280.0100.09724.78
5.5.270.0030.09724.77
5.5.260.0100.07724.75
5.5.250.0000.07024.58
5.5.240.0030.06324.04
5.5.230.0130.07723.84
5.5.220.0070.09324.13
5.5.210.0100.08324.04
5.5.200.0070.08324.12
5.5.190.0070.08323.98
5.5.180.0070.05024.01
5.5.160.0100.08024.11
5.5.150.0030.07724.13
5.5.140.0070.08024.11
5.5.130.0130.07324.03
5.5.120.0030.09324.09
5.5.110.0030.08724.11
5.5.100.0030.08323.93
5.5.90.0030.09323.98
5.5.80.0070.08723.77
5.5.70.0130.08324.01
5.5.60.0070.04723.95
5.5.50.0070.08723.82
5.5.40.0100.08724.01
5.5.30.0030.05023.90
5.5.20.0030.05723.79
5.5.10.0000.06323.84
5.5.00.0170.08023.94
5.4.450.0030.09723.13
5.4.440.0100.04323.08
5.4.430.0000.07023.02
5.4.420.0030.04723.15
5.4.410.0070.09023.10
5.4.400.0000.09022.69
5.4.390.0000.09322.68
5.4.380.0170.07022.83
5.4.370.0100.08322.85
5.4.360.0070.06322.68
5.4.350.0070.08022.70
5.4.340.0070.08722.76
5.4.320.0100.09022.82
5.4.310.0070.08022.83
5.4.300.0070.08722.91
5.4.290.0100.08022.68
5.4.280.0030.09022.86
5.4.270.0070.08022.82
5.4.260.0100.08022.90
5.4.250.0070.07322.89
5.4.240.0100.07322.97
5.4.230.0070.06022.69
5.4.220.0070.09322.86
5.4.210.0100.06022.83
5.4.200.0070.09022.89
5.4.190.0100.08722.82
5.4.180.0070.06322.97
5.4.170.0100.07022.80
5.4.160.0000.08022.89
5.4.150.0100.08322.82
5.4.140.0070.09020.09
5.4.130.0000.08720.02
5.4.120.0070.08720.21
5.4.110.0100.07320.17
5.4.100.0030.09020.29
5.4.90.0130.07720.14
5.4.80.0070.08320.26
5.4.70.0100.04320.10
5.4.60.0030.08720.20
5.4.50.0070.08720.29
5.4.40.0000.08320.16
5.4.30.0030.05320.29
5.4.20.0070.08320.14
5.4.10.0030.08320.19
5.4.00.0000.08319.71
5.3.290.0030.06718.38
5.3.280.0100.07018.23
5.3.270.0000.06718.34
5.3.260.0100.08718.45
5.3.250.0030.08018.32
5.3.240.0030.09018.32
5.3.230.0130.08318.27
5.3.220.0100.08318.38
5.3.210.0070.08718.41
5.3.200.0100.08318.33
5.3.190.0000.08018.35
5.3.180.0130.08018.24
5.3.170.0030.07318.31
5.3.160.0070.08718.23
5.3.150.0070.08718.32
5.3.140.0070.04718.34
5.3.130.0030.06318.36
5.3.120.0100.08318.31
5.3.110.0000.07718.31
5.3.100.0130.07318.17
5.3.90.0000.09017.73
5.3.80.0100.08317.71
5.3.70.0070.09017.61
5.3.60.0030.08017.67
5.3.50.0100.07717.72
5.3.40.0000.08717.55
5.3.30.0030.06317.59
5.3.20.0000.08317.42
5.3.10.0070.07717.29
5.3.00.0070.08017.15
5.2.170.0030.06016.91
5.2.160.0000.06316.77
5.2.150.0070.05716.81
5.2.140.0100.06316.70
5.2.130.0000.08016.86
5.2.120.0100.07316.66
5.2.110.0070.07016.70
5.2.100.0030.06016.80
5.2.90.0030.08316.80
5.2.80.0070.07016.71
5.2.70.0130.07016.72
5.2.60.0070.07016.67
5.2.50.0000.07316.63
5.2.40.0100.06316.58
5.2.30.0170.05716.63
5.2.20.0130.07016.71
5.2.10.0100.07016.41
5.2.00.0030.07316.49
5.1.60.0030.08016.98
5.1.50.0100.05017.05
5.1.40.0130.06717.09
5.1.30.0000.07717.27
5.1.20.0030.08017.06
5.1.10.0100.05017.16
5.1.00.0030.05312.25
5.0.50.0070.04012.25
5.0.40.0030.03012.25
5.0.30.0030.05312.25
5.0.20.0030.04312.25
5.0.10.0030.04312.25
5.0.00.0070.06012.25
4.4.90.0030.02712.25
4.4.80.0030.03312.25
4.4.70.0030.03312.25
4.4.60.0000.04012.25
4.4.50.0070.02712.25
4.4.40.0000.05012.25
4.4.30.0000.02712.25
4.4.20.0030.03012.25
4.4.10.0070.03312.25
4.4.00.0030.05312.25
4.3.110.0000.02312.25
4.3.100.0000.03712.25
4.3.90.0030.03312.25
4.3.80.0000.05712.25
4.3.70.0030.03312.25
4.3.60.0030.03312.25
4.3.50.0000.03312.25
4.3.40.0000.05012.25
4.3.30.0000.03012.25
4.3.20.0000.04012.25
4.3.10.0000.03012.25
4.3.00.0030.03312.25

preferences:
27.67 ms | 401 KiB | 5 Q