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.2.00.0000.01721.17
7.1.70.0060.00319.22
7.1.60.0070.02119.32
7.1.50.0030.01018.76
7.1.00.0000.05024.40
7.0.200.0000.01518.44
7.0.140.0070.07324.09
7.0.60.0000.09022.46
7.0.50.0130.03720.39
7.0.40.0030.06019.96
7.0.30.0270.06720.24
7.0.20.0330.05320.19
7.0.10.0000.08720.22
7.0.00.0130.08320.26
5.6.280.0100.08024.99
5.6.210.0000.08024.47
5.6.200.0170.07721.99
5.6.190.0030.09024.07
5.6.180.0000.05024.22
5.6.170.0170.06324.18
5.6.160.0030.07024.18
5.6.150.0100.09321.96
5.6.140.0030.09021.98
5.6.130.0100.06021.96
5.6.120.0070.06024.90
5.6.110.0070.08324.75
5.6.100.0130.09324.91
5.6.90.0070.04724.84
5.6.80.0170.06024.24
5.5.350.0070.04324.27
5.5.340.0130.08721.80
5.5.330.0030.05724.13
5.5.320.0270.05023.99
5.5.310.0370.08024.02
5.5.300.0100.09321.83
5.5.290.0130.04721.81
5.5.280.0170.08324.74
5.5.270.0070.05024.54
5.5.260.0030.05024.66
5.5.250.0170.07724.58
5.5.240.0130.09023.98
5.4.450.0600.07023.34
5.4.440.0330.04723.00
5.4.430.0400.05323.36
5.4.420.0500.06323.16
5.4.410.0500.06022.85
5.4.400.0570.06723.12
5.4.390.0330.06722.89
5.4.380.0470.07322.68
5.4.370.0530.05322.75
5.4.360.0570.07022.93
5.4.350.0570.07022.68
5.4.340.0500.07322.93
5.4.320.0470.05322.88
5.4.310.0530.06722.79
5.4.300.0400.04722.89
5.4.290.0570.05322.88
5.4.280.0630.06722.88
5.4.270.0570.07322.89
5.4.260.0600.07022.79
5.4.250.0500.08322.78
5.4.240.0570.07323.03
5.4.230.0630.06723.11
5.4.220.0530.08722.79
5.4.210.0530.06322.74
5.4.200.0570.05023.11
5.4.190.0570.07322.92
5.4.180.0500.07322.87
5.4.170.0500.07722.87
5.4.160.0500.05722.90
5.4.150.0570.07322.99
5.4.140.0600.06320.13
5.4.130.0570.06320.32
5.4.120.0500.07020.36
5.4.110.0570.06320.31
5.4.100.0570.06320.29
5.4.90.0400.04320.39
5.4.80.0630.06720.24
5.4.70.0530.06020.41
5.4.60.0530.06020.36
5.4.50.0530.07020.10
5.4.40.0600.07020.26
5.4.30.0600.05720.29
5.4.20.0470.05020.34
5.4.10.0470.06020.39
5.4.00.0500.06719.57
5.3.290.0570.07318.46
5.3.280.0500.08018.22
5.3.270.0600.07318.31
5.3.260.0570.07718.38
5.3.250.0500.05718.25
5.3.240.0530.05018.31
5.3.230.0530.08318.29
5.3.220.0570.05718.26
5.3.210.0530.06018.27
5.3.200.0670.06718.24
5.3.190.0400.06718.16
5.3.180.0530.07318.18
5.3.170.0430.04318.27
5.3.160.0530.07318.25
5.3.150.0500.04718.16
5.3.140.0530.07318.30
5.3.130.0530.08018.38
5.3.120.0730.05718.37
5.3.110.0400.04718.22
5.3.100.0470.05717.82
5.3.90.0600.06717.70
5.3.80.0430.07017.69
5.3.70.0600.08317.58
5.3.60.0430.07317.63
5.3.50.0500.04717.68
5.3.40.0600.06317.59
5.3.30.0470.04017.57
5.3.20.0500.07317.74
5.3.10.0430.04017.36
5.3.00.0500.05317.20
5.2.170.0500.05717.05
5.2.160.0430.03316.76
5.2.150.0400.07316.93
5.2.140.0430.03316.75
5.2.130.0430.03716.78
5.2.120.0430.04016.72
5.2.110.0530.05716.72
5.2.100.0470.06716.78
5.2.90.0330.04016.72
5.2.80.0400.05016.76
5.2.70.0430.06716.76
5.2.60.0500.06716.63
5.2.50.0400.05016.74
5.2.40.0400.07016.76
5.2.30.0300.05016.73
5.2.20.0400.06716.69
5.2.10.0400.06716.68
5.2.00.0430.06316.59
5.1.60.0330.05316.93
5.1.50.0370.06316.93
5.1.40.0370.03316.96
5.1.30.0500.05717.42
5.1.20.0400.06717.02
5.1.10.0370.06016.98
5.1.00.0330.03710.05
5.0.50.0200.0439.65
5.0.40.0200.0239.65
5.0.30.0170.0309.65
5.0.20.0130.0239.65
5.0.10.0130.0209.65
5.0.00.0130.0309.65
4.4.90.0170.0239.65
4.4.80.0200.0339.65
4.4.70.0200.0339.65
4.4.60.0200.0309.65
4.4.50.0170.0379.65
4.4.40.0130.0379.65
4.4.30.0170.0309.65
4.4.20.0170.0339.65
4.4.10.0230.0139.65
4.4.00.0300.0209.65
4.3.110.0200.0209.65
4.3.100.0200.0109.65
4.3.90.0100.0179.65
4.3.80.0100.0279.65
4.3.70.0170.0139.65
4.3.60.0130.0179.65
4.3.50.0170.0239.65
4.3.40.0130.0239.65
4.3.30.0070.0139.65
4.3.20.0070.0379.65
4.3.10.0100.0239.65
4.3.00.0070.0139.65

preferences:
35.07 ms | 401 KiB | 5 Q