3v4l.org

run code in 300+ PHP versions simultaneously
<?php // init all variables (so the first time isnt invalid because of variable creation) $a=array(); $b=null; $e=null; $l=100; $i=0; // do 100 times 2 microtime calls with nothing between it while($i++ < $l){ $b=microtime(true); $e=microtime(true); $a[] = $e - $b; } // calculate the average of these values (multiply by 1000 because I dont like the E-7) $an = (array_sum($a) / count($a))*1000; // re-init vars $i = 0; $a=array(); $b=null; $e=null; // do 100 times 2 microtime calls with 2 microtime calls between it while($i++ < $l){ $b=microtime(true); microtime(true); microtime(true); $e=microtime(true); $a[] = $e - $b; } // calculate average $am = (array_sum($a) / count($a))*1000; echo "Average empty: " . $an ."msec\n"; echo "Average filled: " . $am ."msec\n"; echo "Average 2 microtime calls: " . ($am - $an) . 'msec';

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.0090.00319.46
7.1.70.0040.00417.25
7.1.60.0070.01819.17
7.1.50.0130.00316.86
7.1.00.0070.03022.32
7.0.200.0030.00316.82
7.0.140.0130.06721.97
7.0.60.0170.07719.87
7.0.50.0100.07717.66
7.0.40.0100.08319.98
7.0.30.0370.04320.04
7.0.20.0300.04020.12
7.0.10.0200.04720.17
7.0.00.0100.07320.24
5.6.210.0000.06020.52
5.6.200.0070.07018.10
5.6.190.0130.03720.41
5.6.180.0170.04320.27
5.6.170.0370.05320.41
5.6.160.0100.05020.48
5.6.150.0030.08318.18
5.6.140.0070.03718.20
5.6.130.0030.06018.18
5.6.120.0070.05321.12
5.6.110.0130.06721.02
5.6.100.0130.07721.00
5.6.90.0070.08321.11
5.6.80.0070.07720.53
5.6.70.3200.03320.40
5.5.350.0170.05320.31
5.5.340.0030.04018.02
5.5.330.0070.07720.23
5.5.320.0200.04020.16
5.5.310.0130.04320.27
5.5.300.0100.03717.97
5.5.290.0100.07717.92
5.5.280.0100.08020.82
5.5.270.0070.04020.61
5.5.260.0070.06020.77
5.5.250.0070.04020.61
5.5.240.0130.08320.16
5.4.450.0300.07019.57
5.4.440.0170.05319.46
5.4.430.0400.06019.56
5.4.420.0400.05319.20
5.4.410.0170.08319.29
5.4.400.0300.07318.91
5.4.390.0430.06019.18
5.4.380.0230.08019.06
5.4.370.0300.04019.25
5.4.360.0200.07719.22
5.4.350.0170.04319.18
5.4.340.0300.07719.10
5.4.320.0330.06319.13
5.4.310.0230.04719.10
5.4.300.0300.06318.93
5.4.290.0300.03719.24
5.4.280.0330.06318.79
5.4.270.0230.07719.11
5.4.260.0230.04019.15
5.4.250.0230.05718.92
5.4.240.0270.07018.87
5.4.230.0230.04019.08
5.4.220.0200.06018.92
5.4.210.0270.05018.80
5.4.200.0170.07718.93
5.4.190.0170.07719.07
5.4.180.0200.04319.23
5.4.170.0170.05318.79
5.4.160.0270.06719.07
5.4.150.0270.06718.89
5.4.140.0230.05316.27
5.4.130.0270.06716.37
5.4.120.0200.07016.54
5.4.110.0300.03716.34
5.4.100.0170.07716.11
5.4.90.0300.04316.50
5.4.80.0300.04016.20
5.4.70.0300.04716.41
5.4.60.0170.04316.37
5.4.50.0330.06016.36
5.4.40.0270.05716.36
5.4.30.0230.07016.44
5.4.20.0370.06016.23
5.4.10.0370.03716.20
5.4.00.0200.04315.68
5.3.290.0270.05014.53
5.3.280.0200.07314.70
5.3.270.0270.06714.67
5.3.260.0330.04014.71
5.3.250.0270.07014.57
5.3.240.0300.06014.57
5.3.230.0270.06314.64
5.3.220.0400.06014.61
5.3.210.0330.05314.57
5.3.200.0300.03714.43
5.3.190.0300.06014.45
5.3.180.0200.04714.56
5.3.170.0230.04714.46
5.3.160.0230.06314.52
5.3.150.0170.04314.49
5.3.140.0270.07014.43
5.3.130.0330.06714.50
5.3.120.0330.06014.47
5.3.110.0300.06014.59
5.3.100.0230.04314.10
5.3.90.0470.05313.88
5.3.80.0230.07713.99
5.3.70.0270.04014.13
5.3.60.0330.05313.97
5.3.50.0200.03713.79
5.3.40.0200.04713.87
5.3.30.0200.07713.71
5.3.20.0200.06713.80
5.3.10.0370.06013.58
5.3.00.0270.06013.50
5.2.170.0130.04312.05
5.2.160.0230.05712.05
5.2.150.0170.04312.05
5.2.140.0170.05012.05
5.2.130.0200.03712.05
5.2.120.0300.02712.05
5.2.110.0200.04012.05
5.2.100.0170.04312.05
5.2.90.0230.05712.05
5.2.80.0270.04712.05
5.2.70.0300.04312.05
5.2.60.0230.04012.05
5.2.50.0270.05712.05
5.2.40.0170.05712.05
5.2.30.0170.03712.05
5.2.20.0130.05712.05
5.2.10.0170.04312.05
5.2.00.0200.03312.05
5.1.60.0230.03712.05
5.1.50.0270.03712.05
5.1.40.0170.05312.05
5.1.30.0170.03012.05
5.1.20.0230.05012.05
5.1.10.0100.04712.05
5.1.00.0230.04712.05
5.0.50.0100.04312.05
5.0.40.0030.02312.05
5.0.30.0000.04712.05
5.0.20.0030.04312.05
5.0.10.0000.04012.05
5.0.00.0000.05312.05
4.4.90.0130.02712.05
4.4.80.0100.03312.05
4.4.70.0070.03312.05
4.4.60.0070.02012.05
4.4.50.0030.01712.05
4.4.40.0100.02712.05
4.4.30.0070.03312.05
4.4.20.0100.03312.05
4.4.10.0100.03312.05
4.4.00.0030.05312.05
4.3.110.0030.03312.05
4.3.100.0070.02312.05
4.3.90.0030.03312.05
4.3.80.0000.03012.05
4.3.70.0000.03312.05
4.3.60.0030.01312.05
4.3.50.0000.02012.05
4.3.40.0000.05712.05
4.3.30.0000.03012.05
4.3.20.0100.03012.05
4.3.10.0000.03712.05
4.3.00.0000.04012.05

preferences:
39.65 ms | 400 KiB | 5 Q