3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time = [0, 0, 0, 0];for($i = 0; $i < 50; ++$i){ $k = 0; $t = microtime(true); $x = 0; for($j = 0; $j < 10000000; ++$j) ++$x; $time[$k++] += microtime(true) - $t; $t = microtime(true); $x = 0; for($j = 0; $j < 10000000; ++$j) $x++; $time[$k++] += microtime(true) - $t; $t = microtime(true); $x = 0; for($j = 0; $j < 10000000; ++$j) $x += 1; $time[$k++] += microtime(true) - $t; $t = microtime(true); $x = 0; for($j = 0; $j < 10000000; ++$j) $x = $x + 1; $time[$k++] += microtime(true) - $t; } echo '++$x: ', $time[0] * 1000, 'ms<br />'; echo '$x++: ', $time[1] * 1000, 'ms<br />'; echo '$x += 1: ', $time[2] * 1000, 'ms<br />'; echo '$x = $x + 1: ', $time[3] * 1000, 'ms<br />';

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.1.70.0032.49817.08
7.1.60.0132.48819.40
7.1.50.0032.49817.26
7.1.00.0002.50022.35
7.0.200.0032.49816.81
7.0.140.0032.49721.96
7.0.60.0032.49720.04
7.0.50.0032.49717.82
7.0.40.0102.49019.99
7.0.30.0232.47719.76
7.0.20.0332.46719.65
7.0.10.0072.49319.81
7.0.00.0132.48719.73
5.6.280.0102.49020.90
5.6.210.0032.49720.51
5.6.200.0032.49718.09
5.6.190.0102.49020.37
5.6.180.0272.47320.30
5.6.170.0272.47320.33
5.6.160.0032.49720.36
5.6.150.0032.49717.93
5.6.140.0102.49018.16
5.6.130.0072.49318.13
5.6.120.0202.48021.05
5.6.110.0072.49321.10
5.6.100.0102.49021.03
5.6.90.0132.48721.00
5.6.80.0132.48720.38
5.5.350.0132.48720.38
5.5.340.0172.48317.74
5.5.330.0072.49320.21
5.5.320.0272.47320.19
5.5.310.0272.47320.03
5.5.300.0072.49317.97
5.5.290.0032.49717.73
5.5.280.0072.49320.89
5.5.270.0032.49720.89
5.5.260.0072.49320.87
5.5.250.0102.49020.47
5.5.240.0002.50020.20
5.4.450.0802.41019.08
5.4.440.0132.42719.34
5.4.430.0702.42019.18
5.4.420.0702.42019.50
5.4.410.0272.43318.69
5.4.400.0202.13718.80
5.4.390.0372.45718.56
5.4.380.0132.48318.68
5.4.370.0072.41318.52
5.4.360.0102.39018.65
5.4.350.0162.05611.98
5.4.340.0101.99811.98
5.4.320.0071.99512.46
5.4.310.0401.97012.46
5.4.300.0191.98512.46
5.4.290.0101.99312.46
5.4.280.0201.98212.36
5.4.270.0141.98712.36
5.4.260.0091.99412.36
5.4.250.0071.99612.36
5.4.240.0101.99512.36
5.4.230.0131.99212.35
5.4.220.0211.98412.35
5.4.210.0151.99112.35
5.4.200.0211.98112.35
5.4.190.0131.98912.35
5.4.180.0071.99512.34
5.4.170.0091.99212.36
5.4.160.0091.99312.35
5.4.150.0091.99112.35
5.4.140.0101.99312.03
5.4.130.0061.99412.02
5.4.120.0071.99511.98
5.4.110.0101.99311.97
5.4.100.0121.99111.98
5.4.90.0071.99411.98
5.4.80.0101.99211.98
5.4.70.0071.99411.97
5.4.60.0121.99011.97
5.4.50.0041.99611.97
5.4.40.0111.99411.96
5.4.30.0101.99311.96
5.4.20.0061.99511.96
5.4.10.0081.99111.96
5.4.00.0091.99311.45
5.3.290.0040.04412.80
5.3.280.0060.03712.70
5.3.270.0120.03712.72
5.3.260.0050.04512.72
5.3.250.0060.03612.72
5.3.240.0080.04012.72
5.3.230.0050.04212.71
5.3.220.0070.03612.68
5.3.210.0060.04112.68
5.3.200.0050.03712.68
5.3.190.0110.03212.67
5.3.180.0070.03812.67
5.3.170.0040.03812.67
5.3.160.0080.03812.68
5.3.150.0080.03912.67
5.3.140.0100.03212.66
5.3.130.0060.04512.66
5.3.120.0060.03712.66
5.3.110.0050.03812.66
5.3.100.0080.03312.12
5.3.90.0070.04512.09
5.3.80.0080.03912.07
5.3.70.0090.04012.08
5.3.60.0070.04812.07
5.3.50.0060.03712.00
5.3.40.0070.03512.00
5.3.30.0010.04011.95
5.3.20.0050.03511.73
5.3.10.0040.03711.70
5.3.00.0070.03511.68
5.2.170.0070.0299.18
5.2.160.0040.0309.18
5.2.150.0040.0419.18
5.2.140.0030.0329.18
5.2.130.0060.0289.14
5.2.120.0050.0309.14
5.2.110.0050.0289.15
5.2.100.0090.0249.14
5.2.90.0060.0289.14
5.2.80.0070.0289.14
5.2.70.0070.0309.14
5.2.60.0060.0299.09
5.2.50.0070.0319.05
5.2.40.0070.0269.03
5.2.30.0020.0319.01
5.2.20.0050.0319.00
5.2.10.0050.0318.93
5.2.00.0030.0318.79
5.1.60.0040.0238.06
5.1.50.0060.0268.06
5.1.40.0060.0278.05
5.1.30.0050.0298.40
5.1.20.0040.0268.42
5.1.10.0060.0318.14
5.1.00.0060.0298.14
5.0.50.0070.0226.63
5.0.40.0060.0196.48
5.0.30.0050.0296.29
5.0.20.0030.0196.27
5.0.10.0020.0216.24
5.0.00.0030.0316.23
4.4.90.0040.0144.78
4.4.80.0030.0164.75
4.4.70.0050.0134.76
4.4.60.0020.0164.75
4.4.50.0010.0164.77
4.4.40.0020.0274.71
4.4.30.0020.0214.76
4.4.20.0030.0254.84
4.4.10.0040.0154.85
4.4.00.0020.0274.76
4.3.110.0050.0154.67
4.3.100.0030.0144.67
4.3.90.0020.0194.63
4.3.80.0030.0234.58
4.3.70.0020.0174.63
4.3.60.0040.0174.63
4.3.50.0030.0154.63
4.3.40.0030.0244.54
4.3.30.0000.0203.29
4.3.20.0030.0163.26
4.3.10.0030.0163.22
4.3.00.0170.0207.12

preferences:
41.78 ms | 401 KiB | 5 Q