3v4l.org

run code in 300+ PHP versions simultaneously
<?php function count_to_ten() { yield 1; yield 2; yield from [3, 4]; yield from new ArrayIterator([5, 6]); yield from seven_eight(); return yield from nine_ten(); } function seven_eight() { yield 7; yield from eight(); } function eight() { yield 8; } function nine_ten() { yield 9; //return 10; } $gen = count_to_ten(); foreach ($gen as $num) { echo "$num "; }

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.0120.00916.50
8.3.50.0080.01021.20
8.3.40.0100.00718.75
8.3.30.0110.00318.74
8.3.20.0040.00420.26
8.3.10.0040.00423.48
8.3.00.0000.01119.80
8.2.180.0100.01018.32
8.2.170.0070.01122.96
8.2.160.0070.00720.57
8.2.150.0040.00424.18
8.2.140.0050.00224.66
8.2.130.0040.00426.16
8.2.120.0000.00817.63
8.2.110.0090.00321.09
8.2.100.0080.00417.97
8.2.90.0030.00518.95
8.2.80.0000.00917.97
8.2.70.0060.00617.63
8.2.60.0030.00517.93
8.2.50.0050.00518.10
8.2.40.0080.00019.46
8.2.30.0040.00418.05
8.2.20.0040.00417.69
8.2.10.0050.00318.11
8.2.00.0040.00417.94
8.1.280.0110.00425.92
8.1.270.0120.00622.01
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00023.83
8.1.230.0070.00317.77
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0080.00317.23
8.1.190.0080.00017.23
8.1.180.0000.00918.10
8.1.170.0030.00618.56
8.1.160.0050.00221.93
8.1.150.0000.00718.91
8.1.140.0080.00017.50
8.1.130.0030.00317.58
8.1.120.0040.00417.50
8.1.110.0000.00717.52
8.1.100.0070.00017.49
8.1.90.0030.00417.52
8.1.80.0000.00817.46
8.1.70.0040.00417.46
8.1.60.0040.00417.63
8.1.50.0060.00317.48
8.1.40.0040.00417.52
8.1.30.0090.00017.55
8.1.20.0000.00817.66
8.1.10.0070.00017.53
8.1.00.0030.00517.55
8.0.300.0040.00418.77
8.0.290.0080.00016.75
8.0.280.0000.00718.48
8.0.270.0000.00717.31
8.0.260.0030.00317.30
8.0.250.0000.00716.97
8.0.240.0070.00016.98
8.0.230.0000.00716.93
8.0.220.0040.00416.85
8.0.210.0030.00316.79
8.0.200.0060.00016.93
8.0.190.0000.00816.82
8.0.180.0000.00816.93
8.0.170.0080.00016.87
8.0.160.0030.00316.94
8.0.150.0030.00516.76
8.0.140.0070.00016.81
8.0.130.0050.00213.30
8.0.120.0060.00316.86
8.0.110.0040.00416.91
8.0.100.0040.00416.85
8.0.90.0030.00516.70
8.0.80.0100.01016.84
8.0.70.0040.00416.89
8.0.60.0030.00516.88
8.0.50.0040.00416.74
8.0.30.0020.01617.21
8.0.20.0140.00617.41
8.0.10.0070.00017.02
8.0.00.0110.00616.83
7.4.330.0000.00515.08
7.4.320.0000.00616.59
7.4.300.0000.00716.42
7.4.290.0030.00316.51
7.4.280.0040.00416.58
7.4.270.0030.00316.55
7.4.260.0040.00416.50
7.4.250.0080.00016.60
7.4.240.0050.00216.54
7.4.230.0030.00316.49
7.4.220.0060.01216.36
7.4.210.0110.00316.64
7.4.200.0030.00316.58
7.4.160.0130.00316.45
7.4.150.0180.00717.40
7.4.140.0130.00817.86
7.4.130.0080.01116.49
7.4.120.0160.00516.57
7.4.110.0160.00616.55
7.4.100.0140.00916.44
7.4.90.0060.01216.54
7.4.80.0190.00319.39
7.4.70.0100.00716.65
7.4.60.0100.00716.50
7.4.50.0000.00816.39
7.4.40.0110.00416.51
7.4.30.0130.00716.45
7.4.00.0080.00814.66
7.3.330.0000.00513.10
7.3.320.0050.00013.13
7.3.310.0030.00316.25
7.3.300.0070.00016.27
7.3.290.0070.01016.33
7.3.280.0050.01016.30
7.3.270.0120.00417.40
7.3.260.0110.00616.57
7.3.250.0120.00816.47
7.3.240.0130.00416.39
7.3.230.0120.00616.51
7.3.210.0110.00516.60
7.3.200.0080.00816.56
7.3.190.0030.01316.56
7.3.180.0200.00016.29
7.3.170.0100.01016.32
7.3.160.0130.00916.50
7.3.120.0040.01314.71
7.3.110.0030.00914.80
7.3.100.0100.00714.86
7.3.90.0090.00914.73
7.3.80.0070.00714.84
7.3.70.0070.00714.85
7.3.60.0030.01015.00
7.3.50.0030.01014.41
7.3.40.0070.00714.94
7.3.30.0000.01314.89
7.3.20.0030.01016.86
7.3.10.0110.00516.68
7.3.00.0060.01416.65
7.2.330.0090.00916.78
7.2.320.0060.01616.52
7.2.310.0120.00916.41
7.2.300.0080.00816.46
7.2.290.0040.01516.65
7.2.250.0070.00715.24
7.2.240.0070.01115.21
7.2.230.0100.00715.18
7.2.220.0070.01415.18
7.2.210.0070.00314.68
7.2.200.0040.01115.19
7.2.190.0060.00614.92
7.2.180.0140.00415.18
7.2.170.0110.00415.07
7.2.130.0090.00916.68
7.2.120.0130.00716.97
7.2.110.0130.00616.85
7.2.100.0100.00716.55
7.2.90.0130.00316.66
7.2.80.0100.00716.62
7.2.70.0060.00917.04
7.2.60.0050.00816.73
7.2.50.0030.00716.63
7.2.40.0000.00916.72
7.2.30.0130.00316.83
7.2.20.0080.00316.67
7.2.10.0110.00716.65
7.2.00.0070.00818.04
7.1.330.0030.01415.91
7.1.320.0030.01016.05
7.1.310.0090.00315.85
7.1.300.0040.00815.57
7.1.290.0070.00715.77
7.1.280.0080.00815.57
7.1.270.0090.00615.62
7.1.260.0040.01115.79
7.1.250.0120.00615.50
7.1.200.0070.00715.88
7.1.100.0030.00818.01
7.1.70.0000.00817.28
7.1.60.0130.00619.13
7.1.50.0180.01834.87
7.1.00.0030.07722.48
7.0.200.0000.00716.72
7.0.60.0030.09019.94
7.0.50.0030.05317.86
7.0.40.0100.08720.10
7.0.30.0270.07320.13
7.0.20.0300.05320.22
7.0.10.0130.08320.24
7.0.00.0000.05020.09
5.6.280.0000.03721.13
5.6.210.0100.07720.74
5.6.200.0100.08718.16
5.6.190.0130.08320.61
5.6.180.0470.07020.55
5.6.170.0400.07320.71
5.6.160.0070.08320.48
5.6.150.0070.04718.16
5.6.140.0200.07018.17
5.6.130.0030.04018.18
5.6.120.0100.08321.00
5.6.110.0030.04021.00
5.6.100.0200.07321.04
5.6.90.0170.07021.00
5.6.80.0100.05020.37
5.5.350.0400.06720.52
5.5.340.0030.07018.07
5.5.330.0100.08020.40
5.5.320.0030.08020.27
5.5.310.0270.09320.37
5.5.300.0100.06718.01
5.5.290.0030.05718.03
5.5.280.0070.03720.98
5.5.270.0130.08020.88
5.5.260.0070.07720.95
5.5.250.0000.06320.58
5.5.240.0070.07320.19
5.4.450.0830.04719.30
5.4.440.0730.06019.54
5.4.430.0630.05319.46
5.4.420.0600.05719.36
5.4.410.0570.05719.55
5.4.400.0600.05319.16
5.4.390.0800.05018.87
5.4.380.0800.05019.20
5.4.370.0770.05319.32
5.4.360.0730.05719.26
5.4.350.0830.05719.21
5.4.340.0800.05019.14
5.4.320.0530.06719.13
5.4.310.0700.04019.14
5.4.300.0600.06019.31
5.4.290.0730.05319.20
5.4.280.0770.05719.23
5.4.270.0030.05718.87
5.4.260.0100.05019.04
5.4.250.0070.05319.04
5.4.240.0370.05019.15
5.4.230.0600.05319.12
5.4.220.0570.06018.85
5.4.210.0670.05319.29
5.4.200.0530.05719.20
5.4.190.0630.04718.82
5.4.180.0700.04019.22
5.4.170.0700.06019.23
5.4.160.0770.05019.02
5.4.150.0530.06018.84
5.4.140.0630.04716.51
5.4.130.0570.05316.55
5.4.120.0600.04716.55
5.4.110.0530.05716.41
5.4.100.0600.04716.68
5.4.90.0800.04716.54
5.4.80.0800.04316.60
5.4.70.0170.03016.43
5.4.60.0200.05316.49
5.4.50.0030.06716.32
5.4.40.0330.06716.52
5.4.30.0170.06316.42
5.4.20.0100.03716.53
5.4.10.0200.04316.42

preferences:
57.34 ms | 401 KiB | 5 Q