3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { while (true) { yield mt_rand(1, 2) => 'foo'; } } $foo = foo(); $foo->next(); echo $foo->key(), ' => ', $foo->current(), PHP_EOL; $foo->next(); echo $foo->key(), ' => ', $foo->current(), PHP_EOL; $foo->next(); echo $foo->key(), ' => ', $foo->current(), PHP_EOL; $foo->next(); echo $foo->key(), ' => ', $foo->current(), 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.0000.01219.56
7.1.70.0050.00316.96
7.1.60.0070.01719.13
7.1.50.0030.01716.90
7.1.00.0000.07722.57
7.0.200.0330.01014.45
7.0.60.0070.07719.84
7.0.50.0030.07017.84
7.0.40.0000.07320.09
7.0.30.0400.07720.33
7.0.20.0300.04320.07
7.0.10.0370.07020.12
7.0.00.0030.05720.09
5.6.280.0070.07021.10
5.6.210.0130.06720.56
5.6.200.0030.04018.29
5.6.190.0070.04320.46
5.6.180.0030.04320.46
5.6.170.0330.06720.47
5.6.160.0000.09020.54
5.6.150.0130.07318.19
5.6.140.0130.07718.27
5.6.130.0100.08318.28
5.6.120.0030.04021.10
5.6.110.0100.03721.09
5.6.100.0130.06021.11
5.6.90.0030.06721.09
5.6.80.0100.03720.28
5.6.70.0330.07020.52
5.5.350.0030.08020.49
5.5.340.0070.07718.03
5.5.330.0030.04020.43
5.5.320.0030.08320.51
5.5.310.0330.06320.29
5.5.300.0100.07718.09
5.5.290.0100.07717.94
5.5.280.0100.05020.87
5.5.270.0030.08720.79
5.5.260.0100.04020.79
5.5.250.0070.08020.58
5.5.240.0070.05320.37
5.4.450.0230.07319.71
5.4.440.0170.06019.38
5.4.430.0200.05019.59
5.4.420.0200.05319.61
5.4.410.0130.06019.34
5.4.400.0170.05019.32
5.4.390.0200.05019.38
5.4.380.0270.05319.05
5.4.370.0170.06719.15
5.4.360.0200.05319.14
5.4.350.0130.06019.01
5.4.340.0200.06018.98
5.4.320.0200.05319.15
5.4.310.0170.05318.98
5.4.300.0270.04319.16
5.4.290.0230.04718.98
5.4.280.0170.05719.15
5.4.270.0300.04319.27
5.4.260.0100.05719.37
5.4.250.0200.05319.05
5.4.240.0200.05018.84
5.4.230.0200.05019.25
5.4.220.0170.05318.84
5.4.210.0170.05019.25
5.4.200.0270.05019.05
5.4.190.0200.05019.21
5.4.180.0230.04719.22
5.4.170.0370.05019.12
5.4.160.0300.05718.95
5.4.150.0200.05319.20
5.4.140.0230.04316.32
5.4.130.0200.04716.30
5.4.120.0300.04716.35
5.4.110.0230.04316.60
5.4.100.0300.04716.53
5.4.90.0170.04316.61
5.4.80.0100.05016.60
5.4.70.0300.06716.50
5.4.60.0070.05716.17
5.4.50.0200.05316.55
5.4.40.0070.05316.59
5.4.30.0030.06016.48
5.4.20.0200.04716.59
5.4.10.0170.05016.57
5.4.00.0170.04716.16

preferences:
50.25 ms | 403 KiB | 5 Q