3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace { $s = 100000; $start = microtime(true); $i = $s; while($i--) { $a = true; } $end = microtime(true); $g1 = $end-$start; echo 'Global true: ' . sprintf('%f.20', $g1) . "\n"; $start = microtime(true); $i = $s; while($i--) { $a = \true; } $end = microtime(true); $g2 = $end-$start; echo 'Global \true: ' . sprintf('%f.20', $g2) . "\n"; echo 'Global relative difference true to \true ' . sprintf('%f.10', (($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('%f.20', $n1) . "\n"; $start = microtime(true); $i = $s; while($i--) { $a = \true; } $end = microtime(true); $n2 = $end-$start; echo 'Namespace \true: ' . sprintf('%f.20', $n2) . "\n"; echo 'Namespace relative difference true to \true ' . sprintf('%f.10', (($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.120.0070.01414.79
7.3.110.0060.01214.94
7.3.100.0030.01915.07
7.3.90.0000.02014.89
7.3.80.0000.02115.01
7.3.70.0110.01114.91
7.3.60.0070.01414.64
7.3.50.0130.00714.76
7.3.40.0090.00914.68
7.3.30.0030.01614.77
7.3.20.0070.01516.78
7.3.10.0110.01116.66
7.3.00.0130.00916.74
7.2.240.0040.01115.10
7.2.230.0030.01615.29
7.2.220.0060.01615.09
7.2.210.0040.01815.30
7.2.200.0040.01814.98
7.2.190.0090.00614.89
7.2.180.0030.01515.03
7.2.170.0090.00914.83
7.2.160.0030.01614.82
7.2.150.0120.00616.95
7.2.140.0060.01516.95
7.2.130.0070.01016.62
7.2.120.0060.01616.84
7.2.110.0070.01017.02
7.2.100.0040.01416.93
7.2.90.0130.01016.64
7.2.80.0060.01016.72
7.2.70.0040.01516.90
7.2.60.0070.01516.99
7.2.50.0100.01016.94
7.2.40.0060.00916.74
7.2.30.0090.01317.00
7.2.20.0100.01316.92
7.2.10.0030.01716.85
7.2.00.0090.01216.75
7.1.330.0030.02315.95
7.1.320.0060.02215.79
7.1.310.0070.02015.91
7.1.300.0120.01615.84
7.1.290.0060.02215.48
7.1.280.0070.02015.59
7.1.270.0100.01715.75
7.1.260.0000.02216.02
7.1.250.0000.02715.73
7.1.70.0000.01617.02
7.1.60.0070.02719.61
7.1.50.0070.02316.98
7.1.00.0100.07322.57
7.0.200.0730.00614.59
7.0.140.0030.08022.07
7.0.60.0070.09020.06
7.0.50.0030.05717.68
7.0.40.0030.04720.04
7.0.30.0170.09020.09
7.0.20.0330.08320.16
7.0.10.0030.06020.19
7.0.00.0130.07720.24
5.6.210.0030.07320.57
5.6.200.0100.09018.16
5.6.190.0100.04320.56
5.6.180.0370.05320.63
5.6.170.0200.04320.38
5.6.160.0170.08720.50
5.6.150.0070.07318.13
5.6.140.0030.09018.15
5.6.130.0030.05018.13
5.6.120.0170.08321.16
5.6.110.0100.09020.99
5.6.100.0100.07320.99
5.6.90.0070.07021.14
5.6.80.0100.09320.38
5.6.70.3730.05720.51
5.5.350.0070.09020.39
5.5.340.0000.07318.02
5.5.330.0070.09020.45
5.5.320.0370.08020.51
5.5.310.0300.09020.13
5.5.300.0030.09318.01
5.5.290.0030.05717.97
5.5.280.0200.06320.90
5.5.270.0030.09320.88
5.5.260.0100.08720.63
5.5.250.0030.08720.63
5.5.240.0070.07320.17
5.4.450.0470.05019.41
5.4.440.0300.05319.37
5.4.430.0370.04719.11
5.4.420.0170.05719.41
5.4.410.0130.05319.33
5.4.400.0230.04318.93
5.4.390.0230.05019.24
5.4.380.0100.07718.67
5.4.370.0100.07318.52
5.4.360.0270.06018.50
5.4.350.0230.06718.72
5.4.340.0230.06718.66
5.4.320.0040.04912.47
5.4.310.0110.04212.46
5.4.300.0080.04512.46
5.4.290.0070.04512.46
5.4.280.0100.04112.36
5.4.270.0110.05812.36
5.4.260.0080.04612.36
5.4.250.0050.04812.36
5.4.240.0060.04512.36
5.4.230.0100.05312.36
5.4.220.0070.04412.36
5.4.210.0080.04212.36
5.4.200.0070.05012.36
5.4.190.0030.04812.35
5.4.180.0090.04412.35
5.4.170.0050.04812.36
5.4.160.0110.05212.36
5.4.150.0050.04712.35
5.4.140.0060.04612.04
5.4.130.0090.04212.02
5.4.120.0050.04511.98
5.4.110.0080.05411.98
5.4.100.0070.04411.98
5.4.90.0060.04711.98
5.4.80.0080.04511.98
5.4.70.0110.04411.97
5.4.60.0060.04411.97
5.4.50.0080.04511.97
5.4.40.0080.04311.96
5.4.30.0060.04611.96
5.4.20.0050.05911.96
5.4.10.0080.06311.96
5.4.00.0070.06211.45
5.3.290.0140.08012.80
5.3.280.0110.08212.71
5.3.270.0170.12312.72
5.3.260.0120.06912.72
5.3.250.0100.06512.72
5.3.240.0090.06112.71
5.3.230.0090.05612.71
5.3.220.0060.05812.68
5.3.210.0080.05712.68
5.3.200.0070.05812.68
5.3.190.0080.06912.67
5.3.180.0090.05712.68
5.3.170.0060.06212.67
5.3.160.0090.06012.68
5.3.150.0100.07212.67
5.3.140.0070.06112.66
5.3.130.0090.05812.66
5.3.120.0090.05912.65
5.3.110.0050.06112.66
5.3.100.0090.06712.12
5.3.90.0100.07812.09
5.3.80.0100.05112.08
5.3.70.0060.05512.09
5.3.60.0090.05212.07
5.3.50.0050.05612.02
5.3.40.0070.05612.02
5.3.30.0050.05511.98
5.3.20.0050.05511.76
5.3.10.0040.05811.72
5.3.00.0050.06311.71
5.2.170.0050.0319.18
5.2.160.0080.0389.18
5.2.150.0050.0329.18
5.2.140.0080.0279.18
5.2.130.0060.0309.14
5.2.120.0060.0339.14
5.2.110.0080.0309.15
5.2.100.0070.0299.14
5.2.90.0170.0359.14
5.2.80.0060.0359.14
5.2.70.0080.0279.14
5.2.60.0050.0439.09
5.2.50.0100.0279.06
5.2.40.0040.0309.04
5.2.30.0040.0329.01
5.2.20.0070.0309.01
5.2.10.0030.0308.93
5.2.00.0030.0388.79
5.1.60.0100.0298.06
5.1.50.0050.0358.06
5.1.40.0050.0248.04
5.1.30.0040.0278.40
5.1.20.0050.0268.41
5.1.10.0040.0268.14
5.1.00.0050.0258.14
5.0.50.0030.0216.62
5.0.40.0040.0196.48
5.0.30.0030.0346.29
5.0.20.0050.0196.27
5.0.10.0030.0226.24
5.0.00.0050.0316.24
4.4.90.0040.0144.77
4.4.80.0030.0154.76
4.4.70.0030.0154.76
4.4.60.0030.0164.75
4.4.50.0040.0184.77
4.4.40.0040.0314.71
4.4.30.0040.0154.76
4.4.20.0050.0134.84
4.4.10.0030.0174.85
4.4.00.0020.0284.76
4.3.110.0020.0164.67
4.3.100.0050.0124.67
4.3.90.0030.0144.64
4.3.80.0040.0264.58
4.3.70.0050.0134.63
4.3.60.0030.0154.63
4.3.50.0020.0164.62
4.3.40.0040.0294.53
4.3.30.0030.0153.28
4.3.20.0010.0173.26
4.3.10.0020.0153.22
4.3.00.0200.01013.95

preferences:
40.91 ms | 400 KiB | 5 Q