3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace { $s = 10000000; $start = microtime(true); $i = $s; while($i--) { $a = true; } $end = microtime(true); $g1 = $end-$start; echo 'Global true: ' . sprintf('%.20f', $g1) . "\n"; $start = microtime(true); $i = $s; while($i--) { $a = \true; } $end = microtime(true); $g2 = $end-$start; echo 'Global \true: ' . sprintf('%.20f', $g2) . "\n"; echo 'Global relative difference true to \true ' . sprintf('%.10f', (($g2-$g1)*100)/$g1) . "%\n"; } namespace foo { $start = microtime(true); $i = $s; while($i--) { $a = true; } $end = microtime(true); $n1 = $end-$start; echo 'Namespace true: ' . sprintf('%.20f', $n1) . "\n"; $start = microtime(true); $i = $s; while($i--) { $a = \true; } $end = microtime(true); $n2 = $end-$start; echo 'Namespace \true: ' . sprintf('%.20f', $n2) . "\n"; echo 'Namespace relative difference true to \true ' . sprintf('%.10f', (($n2-$n1)*100)/$n1) . "%\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.0080.49216.71
7.3.00.0070.49416.76
7.2.130.0050.46116.72
7.2.120.0020.47316.97
7.2.110.0070.46716.74
7.2.100.0050.46416.88
7.2.90.0020.45216.91
7.2.80.0050.44116.87
7.2.70.0030.48016.76
7.2.60.0080.43716.78
7.2.50.0050.45416.67
7.2.40.0080.44116.90
7.2.30.0030.43616.97
7.2.20.0030.45116.85
7.2.10.0070.45116.94
7.2.00.0070.43617.54
7.1.250.0021.05315.55
7.1.70.0030.43517.09
7.1.60.0100.45019.61
7.1.50.0100.44616.82
7.1.00.0030.53322.40
7.0.200.0710.40414.90
7.0.140.0070.44721.93
7.0.60.0130.45719.96
7.0.50.0030.40017.84
7.0.40.0000.45320.06
7.0.30.0300.43320.02
7.0.20.0230.42020.09
7.0.10.0070.44020.09
7.0.00.0100.42020.20
5.6.280.0070.75321.05
5.6.210.0100.82020.67
5.6.200.0130.84718.15
5.6.190.0030.77720.41
5.6.180.0530.83020.63
5.6.170.0200.85320.45
5.6.160.0100.84020.43
5.6.150.0030.79018.08
5.6.140.0100.81718.22
5.6.130.0170.85018.06
5.6.120.0030.81020.89
5.6.110.0130.90021.15
5.6.100.0070.85021.00
5.6.90.0070.84020.96
5.6.80.0100.87720.41
5.5.350.0270.94720.43
5.5.340.0030.79017.91
5.5.330.0030.86720.40
5.5.320.0230.84020.30
5.5.310.0200.82320.26
5.5.300.0030.83017.95
5.5.290.0100.80317.89
5.5.280.0000.77720.66
5.5.270.0030.85720.74
5.5.260.0070.81020.88
5.5.250.0000.85720.51
5.5.240.0070.85020.09
5.4.450.0130.88719.21
5.4.440.0300.90019.21
5.4.430.0230.90319.44
5.4.420.0130.92019.41
5.4.410.1270.82719.11
5.4.400.0670.97318.89
5.4.390.0530.85319.05
5.4.380.0231.20718.72
5.4.370.0201.33718.64
5.4.360.0231.26018.74
5.4.350.0331.29018.51
5.4.340.0371.30718.56
5.4.320.0120.84612.46
5.4.310.0110.88212.46
5.4.300.0110.96812.47
5.4.290.0150.89812.46
5.4.280.0100.89912.36
5.4.270.0050.82512.36
5.4.260.0110.85212.36
5.4.250.0160.96012.36
5.4.240.0100.83412.36
5.4.230.0060.84512.35
5.4.220.0100.85012.36
5.4.210.0070.87112.35
5.4.200.0131.15312.35
5.4.190.0090.83812.35
5.4.180.0100.83512.35
5.4.170.0070.84312.36
5.4.160.0110.82512.36
5.4.150.0100.81212.35
5.4.140.0100.81212.04
5.4.130.0130.81812.02
5.4.120.0080.85811.98
5.4.110.0090.84711.98
5.4.100.0170.87611.98
5.4.90.0120.86611.98
5.4.80.0100.83111.98
5.4.70.0170.82211.97
5.4.60.0130.89011.97
5.4.50.0180.86111.98
5.4.40.0210.87511.96
5.4.30.0170.88711.96
5.4.20.0060.89511.96
5.4.10.0090.87211.96
5.4.00.0060.89911.45
5.3.290.0071.80612.80
5.3.280.0101.79512.71
5.3.270.0111.81012.72
5.3.260.0141.80312.72
5.3.250.0131.83112.72
5.3.240.0151.89212.72
5.3.230.0091.76312.71
5.3.220.0101.78612.68
5.3.210.0141.79812.68
5.3.200.0111.82712.68
5.3.190.0431.83012.68
5.3.180.0271.83712.67
5.3.170.0151.77512.67
5.3.160.0121.98912.67
5.3.150.0081.78012.68
5.3.140.0071.82312.66
5.3.130.0151.85212.66
5.3.120.0131.83812.66
5.3.110.0141.85812.66
5.3.100.0121.79412.12
5.3.90.0101.85012.09
5.3.80.0091.80612.08
5.3.70.0061.81812.09
5.3.60.0111.89812.07
5.3.50.0371.93012.02
5.3.40.0171.88412.02
5.3.30.0071.81311.98
5.3.20.0241.83011.75
5.3.10.0411.95611.68
5.3.00.0181.66011.66
5.2.170.0070.0279.18
5.2.160.0060.0279.18
5.2.150.0040.0309.18
5.2.140.0040.0319.18
5.2.130.0030.0319.14
5.2.120.0050.0289.14
5.2.110.0040.0309.15
5.2.100.0030.0339.14
5.2.90.0060.0289.14
5.2.80.0040.0369.14
5.2.70.0060.0289.14
5.2.60.0010.0339.09
5.2.50.0040.0299.06
5.2.40.0040.0299.04
5.2.30.0070.0279.02
5.2.20.0040.0309.00
5.2.10.0060.0288.92
5.2.00.0060.0288.78
5.1.60.0050.0278.07
5.1.50.0060.0258.06
5.1.40.0060.0228.05
5.1.30.0040.0268.40
5.1.20.0070.0248.41
5.1.10.0050.0258.14
5.1.00.0040.0258.14
5.0.50.0020.0236.63
5.0.40.0030.0216.48
5.0.30.0030.0346.29
5.0.20.0040.0196.27
5.0.10.0020.0216.24
5.0.00.0010.0326.24
4.4.90.0020.0164.78
4.4.80.0030.0154.76
4.4.70.0020.0164.76
4.4.60.0030.0154.75
4.4.50.0020.0164.77
4.4.40.0020.0264.71
4.4.30.0020.0164.76
4.4.20.0030.0154.85
4.4.10.0010.0174.85
4.4.00.0030.0244.76
4.3.110.0040.0154.67
4.3.100.0030.0154.67
4.3.90.0010.0184.63
4.3.80.0040.0264.58
4.3.70.0010.0164.63
4.3.60.0010.0164.63
4.3.50.0050.0134.63
4.3.40.0030.0254.53
4.3.30.0010.0173.28
4.3.20.0030.0173.26
4.3.10.0020.0163.22
4.3.00.0070.01313.95

preferences:
52.34 ms | 401 KiB | 5 Q