3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function iterator() { for ($i = 1; $i <= 10; $i++) { echo 'pre it' . $i . PHP_EOL;die; $res = yield $i; //var_dump($res); } } $generator = iterator(); foreach ($generator as $val){ echo $val . PHP_EOL; $generator->send('hi'); }
based on cUYp3

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.3.10.0070.00716.77
7.3.00.0040.01116.47
7.2.130.0060.00616.91
7.2.120.0060.00316.98
7.2.110.0060.00617.03
7.2.100.0060.00616.94
7.2.90.0040.01117.00
7.2.80.0000.01717.07
7.2.70.0030.00616.90
7.2.60.0050.00516.85
7.2.50.0070.00716.96
7.2.40.0040.01216.75
7.2.30.0080.00816.45
7.2.20.0110.00417.07
7.2.10.0030.00716.75
7.2.00.0030.01018.03
7.1.250.0030.01015.90
7.1.200.0060.00615.84
7.1.100.0030.01018.22
7.1.70.0020.00517.09
7.1.60.0100.01419.40
7.1.50.0160.01316.96
7.1.00.0030.07322.35
7.0.200.0060.00616.79
7.0.140.0070.07022.02
7.0.60.0030.04019.93
7.0.50.0070.04317.87
7.0.40.0030.04320.11
7.0.30.0230.07720.38
7.0.20.0300.08020.30
7.0.10.0130.08020.33
7.0.00.0030.07720.20
5.6.280.0000.07720.82
5.6.210.0030.04020.51
5.6.200.0030.04018.19
5.6.190.0030.04320.64
5.6.180.0230.08020.50
5.6.170.0330.07720.71
5.6.160.0130.08320.50
5.6.150.0100.05318.29
5.6.140.0030.03718.18
5.6.130.0000.06318.16
5.6.120.0030.05021.07
5.6.110.0070.07721.01
5.6.100.0030.08721.11
5.6.90.0070.03721.11
5.6.80.0000.04020.41
5.5.350.0100.06720.35
5.5.340.0000.09017.98
5.5.330.0030.04020.19
5.5.320.0100.06020.21
5.5.310.0330.07020.34
5.5.300.0070.08318.02
5.5.290.0030.08017.94
5.5.280.0100.05320.95
5.5.270.0030.04320.86
5.5.260.0130.08720.89
5.5.250.0130.03020.61
5.5.240.0330.06720.04
5.4.450.0300.04719.30
5.4.440.0900.05019.54
5.4.430.0630.06719.28
5.4.420.0070.06019.32
5.4.410.0100.05319.01
5.4.400.0030.06018.83
5.4.390.0170.04318.45
5.4.380.0230.04018.75
5.4.370.0070.04018.43
5.4.360.0100.05018.72
5.4.350.0070.05712.04
5.4.340.0080.04212.02
5.4.320.0090.03412.52
5.4.310.0090.03512.52
5.4.300.0090.03712.52
5.4.290.0040.03912.52
5.4.280.0050.03812.41
5.4.270.0050.03712.41
5.4.260.0040.04712.41
5.4.250.0050.03912.41
5.4.240.0050.03712.41
5.4.230.0050.03812.40
5.4.220.0080.03412.40
5.4.210.0080.03312.40
5.4.200.0090.03512.40
5.4.190.0030.03812.39
5.4.180.0060.03512.39
5.4.170.0060.03512.40
5.4.160.0040.03712.40
5.4.150.0050.03712.39
5.4.140.0060.03712.09
5.4.130.0050.03612.07
5.4.120.0040.03712.03
5.4.110.0060.03412.03
5.4.100.0040.03612.03
5.4.90.0030.03912.03
5.4.80.0060.04612.03
5.4.70.0060.03412.03
5.4.60.0030.03612.02
5.4.50.0060.03412.03
5.4.40.0020.03812.02
5.4.30.0040.03612.01
5.4.20.0090.03112.00
5.4.10.0050.03512.01
5.4.00.0060.03511.50
5.3.290.0070.04912.80
5.3.280.0030.04012.71
5.3.270.0060.03812.73
5.3.260.0040.04012.72
5.3.250.0090.03312.72
5.3.240.0060.03712.72
5.3.230.0060.03712.71
5.3.220.0050.03712.68
5.3.210.0050.03912.68
5.3.200.0060.03712.68
5.3.190.0040.04012.68
5.3.180.0080.03412.68
5.3.170.0090.04312.67
5.3.160.0070.03412.67
5.3.150.0040.04012.67
5.3.140.0070.03612.66
5.3.130.0030.04212.66
5.3.120.0050.04012.66
5.3.110.0040.04112.66
5.3.100.0060.03812.13
5.3.90.0050.03612.11
5.3.80.0060.03612.10
5.3.70.0080.03712.09
5.3.60.0050.03712.08
5.3.50.0080.03412.04
5.3.40.0070.03612.02
5.3.30.0070.03411.98
5.3.20.0080.03311.77
5.3.10.0050.03711.74
5.3.00.0050.04111.72
5.2.170.0050.0329.22
5.2.160.0040.0309.22
5.2.150.0040.0309.22
5.2.140.0040.0319.22
5.2.130.0030.0319.18
5.2.120.0060.0299.18
5.2.110.0060.0319.18
5.2.100.0050.0289.18
5.2.90.0030.0319.18
5.2.80.0050.0309.17
5.2.70.0070.0279.17
5.2.60.0020.0339.13
5.2.50.0070.0289.09
5.2.40.0020.0309.08
5.2.30.0040.0309.04
5.2.20.0060.0279.04
5.2.10.0070.0268.95
5.2.00.0040.0298.81
5.1.60.0040.0238.09
5.1.50.0050.0248.09
5.1.40.0060.0238.07
5.1.30.0030.0298.42
5.1.20.0040.0308.44
5.1.10.0050.0258.16
5.1.00.0020.0278.16
5.0.50.0020.0216.64
5.0.40.0010.0216.50
5.0.30.0050.0296.32
5.0.20.0040.0236.28
5.0.10.0030.0216.27
5.0.00.0050.0316.25
4.4.90.0040.0154.78
4.4.80.0020.0164.75
4.4.70.0050.0134.76
4.4.60.0040.0154.75
4.4.50.0000.0184.77
4.4.40.0030.0254.71
4.4.30.0010.0224.75
4.4.20.0030.0204.84
4.4.10.0000.0194.85
4.4.00.0050.0234.76
4.3.110.0020.0164.67
4.3.100.0020.0154.67
4.3.90.0010.0164.63
4.3.80.0010.0274.58
4.3.70.0040.0134.63
4.3.60.0030.0144.63
4.3.50.0030.0174.63
4.3.40.0030.0244.54
4.3.30.0010.0173.30
4.3.20.0020.0163.28
4.3.10.0030.0153.24
4.3.00.0070.01715.96