3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('ITERATIONS', 10000000); $start = microtime(true); $var = 0; while ($var < ITERATIONS) { ++$var; } $stop = microtime(true); printf("Loop type %8s took %f seconds\n", 'while', $stop - $start); $start = microtime(true); $var = 0; do { ++$var; } while ($var < ITERATIONS); $stop = microtime(true); printf("Loop type %8s took %f seconds\n", 'do-while', $stop - $start); $start = microtime(true); for ($var = 0; $var < ITERATIONS; ++$var) { //do nothing } $stop = microtime(true); printf("Loop type %8s took %f seconds\n", 'for', $stop - $start);

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.0030.38119.27
7.1.70.0070.32517.12
7.1.60.0070.32519.31
7.1.50.0200.31034.50
7.0.200.0030.28716.84
5.4.450.4370.61719.50
5.4.440.0100.70019.47
5.4.430.1500.73019.46
5.4.420.4200.71019.45
5.4.410.3870.62719.16
5.4.400.3530.60718.93
5.4.390.2870.59019.16
5.4.380.3370.65319.03
5.4.370.4300.60718.97
5.4.360.4430.60019.06
5.4.350.4170.60319.01
5.4.340.3530.60318.97
5.4.320.4070.61019.14
5.4.310.3970.59019.24
5.4.300.1830.62019.12
5.4.290.0030.66018.87
5.4.280.0030.62318.88
5.4.270.3770.61718.98
5.4.260.4630.60719.09
5.4.250.4130.61319.00
5.4.240.4300.67319.12
5.4.230.4130.61019.02
5.4.220.4070.61319.23
5.4.210.5900.59018.86
5.4.200.3700.60018.89
5.4.190.4370.62019.13
5.4.180.4600.64718.86
5.4.170.3570.63019.14
5.4.160.3500.59019.12
5.4.150.3900.60719.12
5.4.140.3400.62016.44
5.4.130.4330.61316.22
5.4.120.4200.61016.37
5.4.110.4470.61316.35
5.4.100.4170.61316.46
5.4.90.4100.67016.17
5.4.80.0030.66316.48
5.4.70.1570.62316.21
5.4.60.3800.58316.33
5.4.50.0030.65716.13
5.4.40.0030.60716.30
5.4.30.1300.72716.36
5.4.20.4630.60016.29
5.4.10.4000.60316.30
5.4.00.3930.59015.62
5.3.290.3971.52014.62
5.3.280.4031.67014.53
5.3.270.3071.52014.54
5.3.260.3731.54714.50
5.3.250.4171.55014.52
5.3.240.3301.56714.52
5.3.230.4571.57714.68
5.3.220.4571.54314.38
5.3.210.4501.57714.52
5.3.200.4331.60714.49
5.3.190.4031.56314.49
5.3.180.0771.56314.48
5.3.170.0001.55014.49
5.3.160.4071.53714.35
5.3.150.4171.50314.38
5.3.140.0101.60014.64
5.3.130.3471.52314.48
5.3.120.4071.51314.34
5.3.110.4701.79714.42
5.3.100.3731.67313.97
5.3.90.4531.54313.84
5.3.80.4671.78013.85
5.3.70.3771.54313.94
5.3.60.3231.54313.92
5.3.50.3401.56013.88
5.3.40.4431.67313.87
5.3.30.4431.60013.84
5.3.20.4171.61313.61
5.3.10.4371.72713.59
5.3.00.3831.56013.61

preferences:
26.58 ms | 401 KiB | 5 Q