3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); function generate_ints($n){ foreach ( range(0,$n-1) as $number) { yield $number; } } $gen = generate_ints(10); // iterable object can be used in foreach foreach ($gen as $g) { echo $gen->current(); echo $gen->next(); // can't do this: why no error message? }

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.0070.01418.58
8.3.50.0060.00921.14
8.3.40.0040.01118.72
8.3.30.0100.00320.29
8.3.20.0040.00420.33
8.3.10.0080.00021.09
8.3.00.0000.01023.48
8.2.180.0100.01016.50
8.2.170.0040.01622.96
8.2.160.0070.00720.47
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0000.00821.10
8.2.110.0060.00321.03
8.2.100.0030.00917.78
8.2.90.0000.00819.03
8.2.80.0000.00817.97
8.2.70.0060.00317.50
8.2.60.0040.00417.80
8.2.50.0030.00618.10
8.2.40.0000.00918.22
8.2.30.0040.00419.45
8.2.20.0040.00417.48
8.2.10.0030.00617.61
8.2.00.0060.00317.63
8.1.270.0000.00823.99
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0060.00320.94
8.1.230.0080.00317.83
8.1.220.0070.00317.75
8.1.210.0050.00318.77
8.1.200.0000.00917.35
8.1.190.0000.00817.23
8.1.180.0000.00818.10
8.1.170.0080.00018.71
8.1.160.0000.00818.83
8.1.150.0040.00418.54
8.1.140.0050.00217.37
8.1.130.0030.00317.75
8.1.120.0040.00417.52
8.1.110.0040.00417.51
8.1.100.0000.00817.44
8.1.90.0000.00817.54
8.1.80.0040.00417.49
8.1.70.0030.00317.44
8.1.60.0030.00617.56
8.1.50.0050.00217.40
8.1.40.0090.00017.56
8.1.30.0040.00417.49
8.1.20.0000.00917.51
8.1.10.0000.00817.52
8.1.00.0000.00817.49
8.0.300.0050.00318.77
8.0.290.0080.00016.75
8.0.280.0000.00818.50
8.0.270.0000.00717.28
8.0.260.0000.00716.88
8.0.250.0040.00416.97
8.0.240.0000.00816.87
8.0.230.0070.00016.83
8.0.220.0000.00716.82
8.0.210.0090.00016.90
8.0.200.0040.00416.94
8.0.190.0070.00016.88
8.0.180.0070.00016.95
8.0.170.0040.00416.88
8.0.160.0000.00717.00
8.0.150.0040.00416.82
8.0.140.0060.00616.76
8.0.130.0000.00613.32
8.0.120.0040.00416.88
8.0.110.0000.00816.96
8.0.100.0000.00716.76
8.0.90.0050.00216.86
8.0.80.0110.01116.93
8.0.70.0000.00816.96
8.0.60.0000.00916.88
8.0.50.0040.00416.77
8.0.30.0080.01317.19
8.0.20.0030.01617.43
8.0.10.0000.00816.97
8.0.00.0110.00916.67
7.4.330.0050.00016.71
7.4.320.0080.00016.61
7.4.300.0030.00316.49
7.4.290.0070.00016.59
7.4.280.0000.00716.65
7.4.270.0050.00216.63
7.4.260.0000.00613.29
7.4.250.0000.00816.59
7.4.240.0040.00416.42
7.4.230.0070.00016.42
7.4.220.0150.00316.50
7.4.210.0060.01216.62
7.4.200.0000.00716.63
7.4.190.0070.00016.56
7.4.160.0040.01216.64
7.4.150.0110.00917.40
7.4.140.0140.00517.86
7.4.130.0090.00916.47
7.4.120.0140.00616.44
7.4.110.0090.00916.55
7.4.100.0120.00916.55
7.4.90.0140.00616.78
7.4.80.0080.01119.39
7.4.70.0070.01116.47
7.4.60.0130.00316.65
7.4.50.0040.00416.65
7.4.40.0130.00022.77
7.4.30.0130.00716.50
7.4.00.0060.01115.03
7.3.330.0060.00013.44
7.3.320.0000.00513.37
7.3.310.0070.00016.19
7.3.300.0030.00316.24
7.3.290.0070.00716.36
7.3.280.0070.01016.36
7.3.270.0130.00317.40
7.3.260.0060.01318.24
7.3.250.0110.00616.46
7.3.240.0060.00916.60
7.3.230.0060.01016.39
7.3.210.0080.00816.74
7.3.200.0090.00919.39
7.3.190.0070.01116.58
7.3.180.0070.01416.51
7.3.170.0110.00816.57
7.3.160.0090.00616.39
7.3.120.0080.00814.92
7.3.110.0080.00814.84
7.3.100.0030.01314.95
7.3.90.0000.01114.88
7.3.80.0030.00914.75
7.3.70.0040.01114.82
7.3.60.0070.01014.86
7.3.50.0040.00714.91
7.3.40.0060.00914.65
7.3.30.0030.01314.92
7.3.20.0040.01516.75
7.3.10.0140.00216.67
7.3.00.0110.00616.68
7.2.330.0080.01216.71
7.2.320.0190.00316.54
7.2.310.0030.01716.69
7.2.300.0070.01016.74
7.2.290.0030.01316.68
7.2.250.0050.00914.69
7.2.240.0100.01014.99
7.2.230.0070.01115.23
7.2.220.0140.00314.82
7.2.210.0090.00915.19
7.2.200.0060.00915.06
7.2.190.0090.00914.80
7.2.180.0040.01115.00
7.2.170.0040.01415.03
7.2.130.0190.00316.66
7.2.120.0140.01216.67
7.2.110.0180.00316.32
7.2.100.0130.00916.51
7.2.90.0130.00716.53
7.2.80.0120.00616.41
7.2.70.0210.00616.87
7.2.60.0140.00716.81
7.2.50.0160.00416.61
7.2.40.0140.01116.82
7.2.30.0180.00916.43
7.2.20.0140.00716.55
7.2.10.0190.00816.64
7.2.00.0120.00718.01
7.1.330.0030.01215.80
7.1.320.0090.00015.80
7.1.310.0090.00615.74
7.1.300.0030.00915.58
7.1.290.0030.01315.71
7.1.280.0060.00915.89
7.1.270.0060.00915.82
7.1.260.0030.00615.71
7.1.250.0140.00915.58
7.1.100.0000.01318.10
7.1.70.0060.00317.14
7.1.60.0000.01819.17
7.1.50.0220.01434.59
7.1.00.0030.07722.57
7.0.200.0000.01016.85
7.0.140.0070.08722.02
7.0.100.0200.03719.93
7.0.90.0070.06719.92
7.0.80.0100.04020.02
7.0.70.0030.06319.89
7.0.60.0200.06320.03
7.0.50.0270.04020.27
7.0.40.0070.05320.14
7.0.30.0100.05719.93
7.0.20.0100.07320.13
7.0.10.0030.04320.14
7.0.00.0030.05720.01
5.6.280.0100.06721.08
5.6.250.0030.05320.57
5.6.240.0070.04320.70
5.6.230.0070.04020.50
5.6.220.0100.05320.61
5.6.210.0030.08720.64
5.6.200.0000.04721.11
5.6.190.0030.08020.96
5.6.180.0070.07721.07
5.6.170.0100.06321.02
5.6.160.0100.06021.08
5.6.150.0070.03721.03
5.6.140.0130.04021.03
5.6.130.0030.05321.11
5.6.120.0030.08721.01
5.6.110.0030.04321.11
5.6.100.0130.06721.02
5.6.90.0070.08020.93
5.6.80.0100.04320.48
5.6.70.0070.04020.30
5.6.60.0070.03720.42
5.6.50.0000.04320.33
5.6.40.0070.04020.32
5.6.30.0030.03320.50
5.6.20.0030.03320.35
5.6.10.0000.04320.36
5.6.00.0070.03020.42
5.5.380.0130.07020.58
5.5.370.0030.04320.54
5.5.360.0200.06020.34
5.5.350.0100.06720.37
5.5.340.0100.07320.77
5.5.330.0100.03320.64
5.5.320.0030.04720.88
5.5.310.0100.06320.64
5.5.300.0070.04320.86
5.5.290.0100.06020.77
5.5.280.0030.06320.93
5.5.270.0100.04020.88
5.5.260.0070.08720.88
5.5.250.0070.05020.68
5.5.240.0130.04020.27
5.5.230.0030.04320.20
5.5.220.0030.04020.26
5.5.210.0030.04020.20
5.5.200.0070.03720.23
5.5.190.0070.03020.14
5.5.180.0070.03020.08
5.5.160.0030.03320.23
5.5.150.0100.02720.14
5.5.140.0000.03720.13
5.5.130.0200.06719.99
5.5.120.0030.04020.24
5.5.110.0070.07020.11
5.5.100.0000.04320.08
5.5.90.0030.04020.05
5.5.80.0100.03320.11
5.5.70.0100.03320.06
5.5.60.0100.03320.03
5.5.50.0070.03319.94
5.5.40.0070.03720.14
5.5.30.0030.03320.13
5.5.20.0000.04320.16
5.5.10.0030.04019.97
5.5.00.0000.03719.97
5.4.450.0070.06019.36
5.4.440.0030.06719.50
5.4.430.0000.05319.55
5.4.420.0070.05019.36
5.4.410.0000.04719.24
5.4.400.0130.04718.85
5.4.390.0030.04019.05
5.4.380.0070.04019.20
5.4.370.0070.02719.18
5.4.360.0030.04318.84
5.4.350.0030.03719.14
5.4.340.0000.03319.21
5.4.320.0030.03318.88
5.4.310.0030.03319.16
5.4.300.0030.03018.94
5.4.290.0030.05319.21
5.4.280.0030.05019.18
5.4.270.0100.04719.02
5.4.260.0000.05319.09
5.4.250.0030.03719.16
5.4.240.0000.04018.86
5.4.230.0030.04719.13
5.4.220.0070.03719.22
5.4.210.0030.03718.87
5.4.200.0000.04019.00
5.4.190.0030.03719.15
5.4.180.0070.03719.05
5.4.170.0000.04319.15
5.4.160.0000.04018.88
5.4.150.0030.03718.84
5.4.140.0000.04016.43
5.4.130.0030.03016.33
5.4.120.0100.03016.33
5.4.110.0030.03716.48
5.4.100.0100.03016.44
5.4.90.0100.03016.34
5.4.80.0030.03016.47
5.4.70.0070.02716.49
5.4.60.0030.03016.25
5.4.50.0030.03016.29
5.4.40.0070.05016.49
5.4.30.0130.05016.48
5.4.20.0070.07016.47
5.4.10.0100.04716.24
5.4.00.0070.03015.69
5.3.290.0000.04015.54
5.3.280.0130.03015.54
5.3.270.0030.04015.54
5.3.260.0030.03715.54
5.3.250.0070.03315.54
5.3.240.0030.03715.54
5.3.230.0070.04015.54
5.3.220.0030.03015.54
5.3.210.0070.02715.54
5.3.200.0000.03315.54
5.3.190.0030.03715.54
5.3.180.0070.03015.54
5.3.170.0070.02715.54
5.3.160.0000.03315.54
5.3.150.0130.03015.54
5.3.140.0000.03315.54
5.3.130.0030.07015.54
5.3.120.0070.04015.54
5.3.110.0030.03015.54
5.3.100.0030.04315.54
5.3.90.0070.03315.54
5.3.80.0030.04015.54
5.3.70.0030.03715.54
5.3.60.0070.04715.54
5.3.50.0030.03315.54
5.3.40.0000.04015.54
5.3.30.0130.02715.54
5.3.20.0030.06715.54
5.3.10.0000.06015.54
5.3.00.0000.05015.54
5.2.170.0030.03015.54
5.2.160.0070.05315.54
5.2.150.0100.03715.54
5.2.140.0030.05315.54
5.2.130.0030.04315.54
5.2.120.0130.04715.54
5.2.110.0000.03715.54
5.2.100.0030.04015.54
5.2.90.0000.03015.54
5.2.80.0000.03015.54
5.2.70.0070.05715.54
5.2.60.0030.04315.54
5.2.50.0030.05715.54
5.2.40.0230.04315.54
5.2.30.0100.04715.54
5.2.20.0030.06015.54
5.2.10.0030.04715.54
5.2.00.0030.02715.54
5.1.60.0070.02015.54
5.1.50.0030.02015.54
5.1.40.0030.05015.54
5.1.30.0030.04015.54
5.1.20.0000.02715.54
5.1.10.0070.03715.54
5.1.00.0070.04315.54
5.0.50.0000.04315.54
5.0.40.0000.02715.54
5.0.30.0000.03315.54
5.0.20.0030.03015.54
5.0.10.0070.03715.54
5.0.00.0030.03715.54
4.4.90.0030.03315.54
4.4.80.0030.02715.54
4.4.70.0030.03715.54
4.4.60.0000.02315.54
4.4.50.0000.02715.54
4.4.40.0030.03315.54
4.4.30.0000.03315.54
4.4.20.0000.01715.54
4.4.10.0000.01715.54
4.4.00.0000.06015.54
4.3.110.0070.01015.54
4.3.100.0030.01715.54
4.3.90.0000.03715.54
4.3.80.0030.02015.54
4.3.70.0030.02715.54
4.3.60.0000.03715.54
4.3.50.0030.02715.54
4.3.40.0000.03315.54
4.3.30.0000.02015.54
4.3.20.0000.03715.54
4.3.10.0000.02715.54
4.3.00.0000.03715.54

preferences:
61.51 ms | 400 KiB | 5 Q