3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $matchesMatches = function ($matches) { //$m = 1; //yield $m; // could put as a `for` so it is more optimized, but for now, that is premature optimization foreach ($matches as $match) { var_dump($match); // yeild $m; for ($i = 1; $i <= 3; $i++) { // Note that $i is preserved between yields. yield $i; } } }; $matches = [1,2, 3]; $matches = [1 => array('a', 'b'), 2 => array('c', 'd'), 3 => array('e', 'f')]; foreach ($matchesMatches($matches) as $m) { var_dump($m); }
based on RnECR

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.2.00.0030.01019.38
7.1.100.0070.00318.15
7.1.70.0030.00917.38
7.1.60.0070.01619.46
7.1.50.0070.01516.87
7.1.00.0100.06722.31
7.0.200.0060.00614.83
7.0.140.0030.07322.21
7.0.60.0100.06319.79
7.0.50.0130.07317.92
7.0.40.0070.08320.23
7.0.30.0400.04020.23
7.0.20.0270.07720.34
7.0.10.0100.06720.20
7.0.00.0070.08020.20
5.6.280.0070.06320.90
5.6.210.0000.04320.62
5.6.200.0070.04718.14
5.6.190.0000.08720.47
5.6.180.4170.04320.41
5.6.170.0270.08320.55
5.6.160.0030.07020.46
5.6.150.0070.06018.15
5.6.140.0100.05718.14
5.6.130.0000.04718.29
5.6.120.0070.08721.05
5.6.110.0100.08321.02
5.6.100.0130.06720.97
5.6.90.0170.06021.04
5.6.80.0030.06020.34
5.6.70.3600.02720.56
5.5.350.0100.07720.30
5.5.340.0100.08018.07
5.5.330.0100.08020.27
5.5.320.3170.04020.20
5.5.310.0230.08020.34
5.5.300.0030.07018.07
5.5.290.0030.08318.02
5.5.280.0100.08320.88
5.5.270.0170.06320.84
5.5.260.0000.04320.64
5.5.250.0030.06320.49
5.5.240.0300.06720.16
5.4.450.0670.06719.16
5.4.440.1300.07019.61
5.4.430.0900.05319.63
5.4.420.1430.05719.34
5.4.410.0970.06719.50
5.4.400.1170.04319.28
5.4.390.0100.05318.82
5.4.380.0100.05718.70
5.4.370.0130.05318.76
5.4.360.0170.05018.62
5.4.350.0270.05018.54
5.4.340.0100.05718.59
5.4.320.0170.05318.46
5.4.310.0170.04718.73
5.4.300.0130.05318.70
5.4.290.0070.05718.71
5.4.280.0230.04318.77
5.4.270.0230.04318.56
5.4.260.0200.05018.57
5.4.250.0230.04318.78
5.4.240.0270.04318.61
5.4.230.0200.04318.71
5.4.220.0200.05318.66
5.4.210.0200.04718.60
5.4.200.0200.04316.51
5.4.190.0130.05318.71
5.4.180.0170.05018.71
5.4.170.0100.06018.60
5.4.160.0030.06018.71
5.4.150.0100.05318.54
5.4.140.0070.06016.30
5.4.130.0130.04716.29
5.4.120.0070.05716.18
5.4.110.0200.04016.29
5.4.100.0100.05316.30
5.4.90.0030.06016.17
5.4.80.0170.04316.30
5.4.70.0070.05716.24
5.4.60.0100.06316.26
5.4.50.0100.07016.25
5.4.40.0200.06016.39
5.4.30.0100.04716.28
5.4.20.0130.05016.41
5.4.10.0200.05316.22
5.4.00.0130.06315.71
5.3.290.0170.06014.78
5.3.280.0100.05714.80
5.3.270.0100.05714.70
5.3.260.0200.05014.70
5.3.250.0100.07314.63
5.3.240.0230.06314.71
5.3.230.0130.05314.63
5.3.220.0100.05714.59
5.3.210.0200.05014.66
5.3.200.0170.06014.54
5.3.190.0170.05714.64
5.3.180.0170.06714.75
5.3.170.0200.04314.59
5.3.160.0030.06014.65
5.3.150.0100.07314.65
5.3.140.0330.04714.60
5.3.130.0170.06714.53
5.3.120.0200.06714.73
5.3.110.0200.06714.59
5.3.100.0200.06014.25
5.3.90.0170.06714.03
5.3.80.0170.06314.20
5.3.70.0170.04714.07
5.3.60.0030.06014.05
5.3.50.0200.04313.93
5.3.40.0170.04714.05
5.3.30.0170.04314.11
5.3.20.0100.06013.80
5.3.10.0130.05313.64
5.3.00.0100.05313.72
5.2.170.0030.04711.08
5.2.160.0100.04011.17
5.2.150.0070.04711.05
5.2.140.0100.04311.17
5.2.130.0030.04311.13
5.2.120.0000.05011.13
5.2.110.0200.03011.14
5.2.100.0030.04711.13
5.2.90.0030.04711.08
5.2.80.0130.04711.21
5.2.70.0070.05711.11
5.2.60.0130.05011.01
5.2.50.0030.04710.94
5.2.40.0100.04011.15
5.2.30.0100.04711.00
5.2.20.0070.05710.87
5.2.10.0130.03310.88
5.2.00.0100.04010.65
5.1.60.0000.0439.93
5.1.50.0100.03710.11
5.1.40.0070.0379.95
5.1.30.0070.05010.33
5.1.20.0070.05010.47
5.1.10.0170.03710.09
5.1.00.0100.04710.08
5.0.50.0170.0278.54
5.0.40.0070.0378.41
5.0.30.0170.0438.32
5.0.20.0100.0308.18
5.0.10.0000.0338.27
5.0.00.0030.0438.14
4.4.90.0030.0305.91
4.4.80.0030.0305.85
4.4.70.0030.0305.86
4.4.60.0000.0335.90
4.4.50.0030.0335.91
4.4.40.0000.0405.81
4.4.30.0070.0205.90
4.4.20.0070.0235.96
4.4.10.0070.0235.96
4.4.00.0030.0375.91
4.3.110.0030.0235.88
4.3.100.0030.0205.75
4.3.90.0070.0175.81
4.3.80.0070.0335.87
4.3.70.0000.0275.82
4.3.60.0030.0235.79
4.3.50.0030.0235.80
4.3.40.0030.0335.86
4.3.30.0030.0235.00
4.3.20.0000.0275.00
4.3.10.0000.0235.00
4.3.00.0230.01714.62