3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen($a = 0) { yield 1; yield 2; yield 3; yield 4; yield 5; } function bar($gen) { yield from $gen; } $gen = gen(); $gens[] = bar($gen); $gens[] = bar($gen); do { foreach ($gens as $g) { echo "Current: "; var_dump($g->current()); // Notice - We are advancing the underlying gen, not either of the things // gens in the array. If we delegate properly, then our other generators // should be implicitly advancing as well. $gen->next(); } } while($gen->valid()); var_dump($gens[1]->valid());

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)
8.3.60.0090.00616.63
8.3.50.0140.00718.18
8.3.40.0120.00318.79
8.3.30.0110.00418.66
8.3.20.0050.00320.16
8.3.10.0080.00023.36
8.3.00.0080.00019.22
8.2.180.0060.01218.25
8.2.170.0040.01422.96
8.2.160.0130.00320.35
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0030.00717.75
8.2.120.0070.00026.35
8.2.110.0030.00721.00
8.2.100.0040.00817.72
8.2.90.0030.00717.75
8.2.80.0030.00617.97
8.2.70.0030.00517.93
8.2.60.0080.00018.03
8.2.50.0000.00818.10
8.2.40.0000.00720.74
8.2.30.0040.00420.74
8.2.20.0060.00317.76
8.2.10.0030.00518.18
8.2.00.0040.00418.01
8.1.280.0170.00025.92
8.1.270.0060.00623.83
8.1.260.0000.00828.09
8.1.250.0070.00028.09
8.1.240.0030.00619.21
8.1.230.0120.00019.16
8.1.220.0060.00317.78
8.1.210.0050.00318.77
8.1.200.0030.00617.35
8.1.190.0030.00617.23
8.1.180.0030.00618.10
8.1.170.0040.00418.59
8.1.160.0040.00421.94
8.1.150.0080.00018.95
8.1.140.0000.00819.53
8.1.130.0000.00717.57
8.1.120.0000.00717.37
8.1.110.0040.00417.49
8.1.100.0000.00817.44
8.1.90.0000.00817.36
8.1.80.0070.00017.35
8.1.70.0030.00517.27
8.1.60.0030.00517.63
8.1.50.0000.00817.50
8.1.40.0040.00717.54
8.1.30.0000.00917.56
8.1.20.0070.00017.64
8.1.10.0000.00817.55
8.1.00.0070.00017.54
8.0.300.0040.00421.52
8.0.290.0040.00416.75
8.0.280.0030.00318.46
8.0.270.0000.00717.21
8.0.260.0000.00817.29
8.0.250.0000.00616.98
8.0.240.0000.00716.92
8.0.230.0050.00216.91
8.0.220.0000.00716.93
8.0.210.0070.00016.88
8.0.200.0040.00416.86
8.0.190.0000.00716.86
8.0.180.0040.00416.85
8.0.170.0040.00416.92
8.0.160.0030.00416.86
8.0.150.0030.00316.88
8.0.140.0000.00716.81
8.0.130.0000.00613.29
8.0.120.0060.00316.88
8.0.110.0040.00416.81
8.0.100.0040.00416.96
8.0.90.0000.00716.96
8.0.80.0090.00916.86
8.0.70.0040.00416.78
8.0.60.0040.00416.71
8.0.50.0040.00416.96
8.0.30.0100.00717.03
8.0.20.0070.01217.41
8.0.10.0070.00017.02
8.0.00.0050.01216.78
7.4.330.0050.00016.66
7.4.320.0030.00316.59
7.4.300.0000.00716.61
7.4.290.0000.00716.57
7.4.280.0000.01016.41
7.4.270.0000.00716.52
7.4.260.0070.00016.40
7.4.250.0060.00316.55
7.4.240.0000.00716.60
7.4.230.0000.00716.68
7.4.220.0080.01116.48
7.4.210.0110.00916.59
7.4.200.0030.00316.51
7.4.160.0100.00716.73
7.4.150.0120.00417.40
7.4.140.0080.01317.86
7.4.130.0110.00916.41
7.4.120.0120.00516.43
7.4.110.0030.01516.66
7.4.100.0090.01516.63
7.4.90.0140.00416.58
7.4.80.0080.01219.39
7.4.70.0130.00316.41
7.4.60.0130.00616.55
7.4.50.0030.01316.34
7.4.40.0030.01416.76
7.4.30.0040.01316.61
7.4.00.0090.00614.90
7.3.330.0060.00013.24
7.3.320.0060.00013.20
7.3.310.0070.00016.23
7.3.300.0070.00016.22
7.3.290.0070.00816.29
7.3.280.0080.01016.31
7.3.270.0090.00917.40
7.3.260.0060.01016.44
7.3.250.0100.01116.46
7.3.240.0090.00816.47
7.3.230.0130.00416.44
7.3.210.0120.00616.58
7.3.200.0070.01016.40
7.3.190.0130.01016.29
7.3.180.0130.00616.51
7.3.170.0130.00316.59
7.3.160.0090.00616.35
7.3.10.0000.01816.08
7.3.00.0030.00716.08
7.2.330.0090.00916.66
7.2.320.0100.01016.80
7.2.310.0150.00316.49
7.2.300.0120.00616.76
7.2.290.0030.01416.83
7.2.130.0090.00616.50
7.2.120.0030.01016.46
7.2.110.0070.01016.37
7.2.100.0150.00616.47
7.2.90.0040.01516.41
7.2.80.0130.00616.39
7.2.70.0110.01116.40
7.2.60.0130.00516.80
7.2.50.0210.00516.83
7.2.40.0080.01216.63
7.2.30.0150.00416.47
7.2.20.0060.01216.15
7.2.10.0120.00716.34
7.2.00.0090.00818.23
7.1.250.0140.00715.18
7.1.200.0000.01115.86
7.1.100.0070.00718.20
7.1.70.0040.00417.23
7.1.60.0140.01019.48
7.1.50.0100.01317.07
7.1.00.0070.07322.28
7.0.200.0380.00614.98
7.0.60.0030.08720.03
7.0.50.0070.08717.86
7.0.40.0030.04320.21
7.0.30.0230.05020.11
7.0.20.0370.08020.12
7.0.10.0000.05320.19
7.0.00.0100.05320.23
5.6.280.0000.04321.00
5.6.210.0100.08020.48
5.6.200.0130.07718.19
5.6.190.0070.04020.42
5.6.180.0270.04720.41
5.6.170.0300.07720.55
5.6.160.0130.08020.71
5.6.150.0070.06718.12
5.6.140.0070.04718.21
5.6.130.0070.05018.11
5.6.120.0130.07021.15
5.6.110.0100.08021.12
5.6.100.0070.08020.99
5.6.90.0100.06021.04
5.6.80.0100.08020.51
5.5.350.4470.02720.38
5.5.340.0070.08317.95
5.5.330.0130.07020.35
5.5.320.0070.05020.25
5.5.310.0200.04720.34
5.5.300.0100.05717.98
5.5.290.0070.05717.95
5.5.280.0070.05720.90
5.5.270.0130.05020.79
5.5.260.0000.08020.98
5.5.250.0100.06720.61
5.5.240.0430.05720.16

preferences:
49.96 ms | 400 KiB | 5 Q