3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* How many times the code under test should run in each function */ define('LOOP',10000); function f1() { for($i=0; $i<LOOP; ++$i) { foreach (range(0, 100) as $i) { echo $i . PHP_EOL; } } } function f2() { for($i=0; $i<LOOP; ++$i) { for ($i = 0; $i <= 100; $i++) { echo $i . PHP_EOL; } } } $start = microtime(true); f1(); $stop = microtime(true); $time1 = $stop - $start; $start = microtime(true); f2(); $stop = microtime(true); $time2 = $stop - $start; echo $time1 . "\t"; echo $time2 . "\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.2.90.0470.02714.52
7.2.80.1570.02014.68
7.2.70.0580.03315.09
7.2.60.1400.01714.97
7.2.50.0660.02915.04
7.2.40.1980.01715.02
7.2.30.0930.01014.99
7.2.20.1690.02814.79
7.2.10.1880.01214.95
7.2.00.0630.02814.96
7.1.210.0440.01613.93
7.1.200.1590.02113.61
7.1.190.1250.01613.99
7.1.180.0560.03113.68
7.1.170.1640.02014.01
7.1.160.0640.02013.76
7.1.150.0770.03313.70
7.1.140.1530.02313.62
7.1.130.1160.02413.64
7.1.120.1460.02613.80
7.1.110.1490.02313.80
7.1.100.0970.01614.07
7.1.90.0720.02413.96
7.1.80.1360.03213.80
7.1.70.0960.02713.72
7.1.60.0830.03132.04
7.1.50.0960.01631.90
7.1.40.1250.01831.95
7.1.30.0910.04132.07
7.1.20.0780.02231.98
7.1.10.0660.02013.86
7.1.00.0560.01513.58
7.0.310.0580.02413.76
7.0.300.1460.04113.55
7.0.290.0660.01213.68
7.0.280.0350.02113.58
7.0.270.0550.02113.52
7.0.260.1240.01913.34
7.0.250.0330.01113.56
7.0.240.0510.02213.66
7.0.230.0980.02913.62
7.0.220.0950.01613.55
7.0.210.0300.01213.68
7.0.200.0460.01413.61
7.0.190.1120.02513.32
7.0.180.0970.02313.50
7.0.170.0870.03013.46
7.0.160.0830.02413.74
7.0.150.0420.03413.22
7.0.140.0980.01713.28
7.0.130.0550.02813.69
7.0.120.2350.02413.66
7.0.110.0920.01813.68
7.0.100.0500.01713.45
7.0.90.0950.01813.64
7.0.80.0310.03813.73
7.0.70.0560.02513.69
7.0.60.1130.04413.41
7.0.50.0570.01713.79
7.0.40.0510.03113.69
7.0.30.0650.02113.49
7.0.20.0430.02913.52
7.0.10.0480.02713.64
7.0.00.0980.02013.70
5.6.300.0320.02814.69
5.6.290.0410.02914.33
5.6.280.0680.02814.54
5.6.270.0590.02614.37
5.6.260.0480.02914.34
5.6.250.0410.02214.38
5.6.240.0730.02614.07
5.6.230.0390.02614.58
5.6.220.0410.02514.37
5.6.210.0470.02814.45
5.6.200.0450.02114.36
5.6.190.0560.03514.35
5.6.180.0690.01014.03
5.6.170.0410.01514.35
5.6.160.0460.02814.61
5.6.150.0530.02114.45
5.6.140.0380.03514.45
5.6.130.0520.01614.32
5.6.120.0370.02714.05
5.6.110.0620.02414.54
5.6.100.0490.00714.17
5.6.90.0570.02014.43
5.6.80.0300.04114.22
5.6.70.0490.02314.46
5.6.60.0310.03914.19
5.6.50.0460.02214.14
5.6.40.0830.01314.18
5.6.30.0490.01414.26
5.6.20.0740.03714.38
5.5.380.0380.02811.18
5.5.370.0360.03011.05
5.5.360.0410.02611.33
5.5.350.0570.02811.28
5.5.340.0370.03711.01
5.5.330.0370.02310.92
5.5.320.0450.02610.81
5.5.310.0440.01411.12
5.5.300.0180.02311.29
5.5.290.0250.02611.31
5.5.280.0470.02911.35
5.5.270.0520.01411.40
5.5.260.0490.04211.34
5.5.250.0300.02711.23
5.5.240.0250.02511.23
5.5.230.0380.02911.00
5.5.220.0330.03010.95
5.5.210.0350.02610.98
5.5.200.0490.01810.78
5.5.190.0340.02811.07
5.5.180.0280.02811.04
5.4.450.0700.02611.37
5.4.440.0380.02411.11
5.4.430.0440.01311.02
5.4.420.0460.01911.22
5.4.410.0430.03011.25
5.4.400.0180.03910.97
5.4.390.0280.02510.96
5.4.380.0280.02911.14
5.4.370.0580.01811.27
5.4.360.0670.00810.81
5.4.350.0330.01811.13
5.4.340.0720.02411.07

preferences:
46.5 ms | 401 KiB | 5 Q