3v4l.org

run code in 300+ PHP versions simultaneously
<?php $limit = 100000; $t0 = microtime(true); for ($i = 0; $i < $limit; ++$i) { $j = $i % 10 === 0; } echo microtime(true) - $t0 . PHP_EOL; $t0 = microtime(true); for ($i = 0; $i < $limit; ++$i) { $j = $i & 1; } echo microtime(true) - $t0 . PHP_EOL; $t0 = microtime(true); for ($i = 0; $i < $limit; ++$i) { $j = (bool) $i & 10; } echo microtime(true) - $t0 . PHP_EOL;

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.0100.01419.59
7.1.70.0070.01017.00
7.1.60.0130.02219.32
7.1.50.0100.01317.10
7.1.00.0070.08322.41
7.0.200.0040.01116.79
7.0.140.0000.07722.16
7.0.60.0070.09319.93
7.0.50.0070.09317.94
7.0.40.0030.07020.04
7.0.30.0300.05720.04
7.0.20.0300.08720.20
7.0.10.0070.09720.00
7.0.00.0100.08720.29
5.6.280.0030.09321.02
5.6.210.0100.09020.50
5.6.200.0100.04718.12
5.6.190.0100.10320.56
5.6.180.0370.08720.43
5.6.170.0230.07020.50
5.6.160.0170.07020.50
5.6.150.0070.04718.09
5.6.140.0000.05718.10
5.6.130.0000.09718.16
5.6.120.0170.05021.09
5.6.110.0070.08721.02
5.6.100.0130.08320.95
5.6.90.0030.10020.96
5.6.80.0000.08720.47
5.6.70.4030.04720.27
5.5.350.0030.10320.38
5.5.340.0030.10318.02
5.5.330.0000.08720.19
5.5.320.0370.05720.18
5.5.310.0300.07720.30
5.5.300.0070.06718.01
5.5.290.0100.10017.88
5.5.280.0100.08020.95
5.5.270.0100.09020.72
5.5.260.0030.08320.86
5.5.250.0030.07320.69
5.5.240.0330.08720.25
5.4.450.0230.06319.10
5.4.440.0200.05019.10
5.4.430.0270.06019.25
5.4.420.0800.00019.63
5.4.410.0800.00019.37
5.4.400.0800.00018.86
5.4.390.0800.00019.16
5.4.380.0800.00018.95
5.4.370.0800.00019.15
5.4.360.0770.00019.07
5.4.350.0830.00019.14
5.4.340.0080.05011.97
5.4.320.0070.05812.45
5.4.310.0060.05512.45
5.4.300.0050.05912.45
5.4.290.0050.05212.45
5.4.280.0020.05312.35
5.4.270.0070.06712.35
5.4.260.0110.07012.35
5.4.250.0080.05312.35
5.4.240.0070.04912.35
5.4.230.0110.06812.34
5.4.220.0110.08912.34
5.4.210.0090.06312.34
5.4.200.0070.07912.34
5.4.190.0180.08812.34
5.4.180.0080.07412.34
5.4.170.0080.06312.35
5.4.160.0120.04812.35
5.4.150.0090.06212.34
5.4.140.0060.06112.03
5.4.130.0030.05712.01
5.4.120.0090.05511.97
5.4.110.0150.04811.96
5.4.100.0030.05611.96
5.4.90.0060.05411.97
5.4.80.0110.04611.97
5.4.70.0070.05111.96
5.4.60.0090.05111.97
5.4.50.0040.05011.96
5.4.40.0070.04911.95
5.4.30.0040.05611.95
5.4.20.0080.05411.95
5.4.10.0050.05211.95
5.4.00.0100.06811.45
5.3.290.0070.08412.80
5.3.280.0040.05512.71
5.3.270.0090.05712.72
5.3.260.0100.05712.71
5.3.250.0110.07912.71
5.3.240.0100.05412.72
5.3.230.0090.05712.71
5.3.220.0080.07012.68
5.3.210.0040.05912.68
5.3.200.0070.05712.68
5.3.190.0170.08712.67
5.3.180.0070.06012.67
5.3.170.0060.06012.67
5.3.160.0040.05512.67
5.3.150.0050.05412.67
5.3.140.0060.05812.66
5.3.130.0050.06312.66
5.3.120.0130.05012.66
5.3.110.0100.05312.66
5.3.100.0080.05312.12
5.3.90.0090.04912.08
5.3.80.0070.05212.07
5.3.70.0070.05312.07
5.3.60.0090.05112.06
5.3.50.0100.05212.00
5.3.40.0110.04912.00
5.3.30.0050.05211.95
5.3.20.0030.05511.72
5.3.10.0050.05111.70
5.3.00.0080.07011.68
5.2.170.0050.0629.18
5.2.160.0080.0499.18
5.2.150.0050.0529.18
5.2.140.0070.0589.18
5.2.130.0040.0619.14
5.2.120.0060.0549.14
5.2.110.0040.0539.14
5.2.100.0060.0499.14
5.2.90.0080.0509.14
5.2.80.0090.0519.14
5.2.70.0030.0579.14
5.2.60.0060.0539.09
5.2.50.0060.0539.06
5.2.40.0060.0539.04
5.2.30.0050.0549.01
5.2.20.0050.0509.00
5.2.10.0070.0568.95
5.2.00.0050.0588.81
5.1.60.0030.0488.10
5.1.50.0060.0498.09
5.1.40.0050.0488.08
5.1.30.0030.0608.43
5.1.20.0040.0658.45
5.1.10.0030.0608.18
5.1.00.0040.0838.17
5.0.50.0080.1686.66
5.0.40.0060.1556.52
5.0.30.0060.1256.34
5.0.20.0050.0976.30
5.0.10.0050.1096.28
5.0.00.0030.1206.27
4.4.90.0010.0964.77
4.4.80.0030.1034.75
4.4.70.0030.1004.75
4.4.60.0020.0904.75
4.4.50.0010.0914.77
4.4.40.0030.1034.71
4.4.30.0030.0934.76
4.4.20.0020.0984.84
4.4.10.0020.1004.85
4.4.00.0030.1004.76
4.3.110.0030.0944.67
4.3.100.0060.0884.67
4.3.90.0050.0994.63
4.3.80.0020.1124.59
4.3.70.0040.1004.63
4.3.60.0080.1124.63
4.3.50.0030.1154.63
4.3.40.0050.1134.54
4.3.30.0040.1163.34
4.3.20.0050.1223.33
4.3.10.0040.1203.28
4.3.00.0070.08013.21

preferences:
24.61 ms | 401 KiB | 5 Q