3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generate_ints($n){ foreach ( range(0,$n) as $number) { $number = (yield $number); yield $number; } } $gen = generate_ints(5); // iterable object can be used in foreach foreach ($gen as $g) { $c = $gen->current(); echo $c; if ($c == 4) { $gen->send(1); // injecting a value to stop the generator; echo $gen->current(); } }

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.40.0110.00318.63
8.3.30.0090.00920.29
8.3.20.0040.00420.36
8.3.10.0040.00420.79
8.3.00.0070.00023.51
8.2.170.0150.00022.96
8.2.160.0170.00320.44
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0170.00019.77
8.2.110.0090.00019.27
8.2.100.0080.00417.72
8.2.90.0000.00719.21
8.2.80.0050.00317.97
8.2.70.0060.00317.59
8.2.60.0070.00317.93
8.2.50.0040.00818.07
8.2.40.0000.00818.28
8.2.30.0000.00719.38
8.2.20.0050.00217.54
8.2.10.0000.00717.68
8.2.00.0030.00617.66
8.1.270.0050.00323.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0070.00322.36
8.1.230.0110.00020.96
8.1.220.0040.00418.77
8.1.210.0000.00719.00
8.1.200.0110.00017.13
8.1.190.0040.00417.53
8.1.180.0050.00318.10
8.1.170.0040.00418.64
8.1.160.0000.00718.88
8.1.150.0030.00618.64
8.1.140.0040.00417.39
8.1.130.0070.00017.88
8.1.120.0070.00017.39
8.1.110.0080.00017.34
8.1.100.0000.00717.49
8.1.90.0050.00217.39
8.1.80.0000.00717.48
8.1.70.0000.00717.48
8.1.60.0040.00417.55
8.1.50.0000.00717.48
8.1.40.0040.00417.40
8.1.30.0000.00717.66
8.1.20.0050.00317.65
8.1.10.0000.00817.52
8.1.00.0000.00817.46
8.0.300.0040.00420.02
8.0.290.0040.00417.29
8.0.280.0000.00718.36
8.0.270.0000.00817.18
8.0.260.0030.00316.82
8.0.250.0040.00416.96
8.0.240.0080.00016.85
8.0.230.0000.00716.94
8.0.220.0070.00016.89
8.0.210.0040.00416.96
8.0.200.0070.00016.97
8.0.190.0070.00016.88
8.0.180.0040.00416.87
8.0.170.0040.00416.83
8.0.160.0030.00316.77
8.0.150.0000.00716.90
8.0.140.0040.00416.90
8.0.130.0000.00713.26
8.0.120.0000.00716.76
8.0.110.0070.00016.85
8.0.100.0050.00316.78
8.0.90.0040.00416.71
8.0.80.0090.00616.87
8.0.70.0050.00316.75
8.0.60.0030.00616.71
8.0.50.0040.00416.92
8.0.30.0080.01117.06
8.0.20.0140.00617.40
8.0.10.0000.00817.03
8.0.00.0050.01416.82
7.4.330.0050.00016.67
7.4.320.0100.00016.65
7.4.300.0030.00316.52
7.4.290.0060.00016.41
7.4.280.0080.00016.41
7.4.270.0030.00316.47
7.4.260.0000.00813.39
7.4.250.0080.00016.36
7.4.240.0050.00216.51
7.4.230.0000.00716.63
7.4.220.0100.01016.62
7.4.210.0080.00716.62
7.4.200.0030.00316.67
7.4.190.0070.00016.68
7.4.160.0040.01116.43
7.4.150.0090.00617.40
7.4.140.0110.00817.86
7.4.130.0070.01016.51
7.4.120.0110.00916.52
7.4.110.0070.01116.40
7.4.100.0100.00716.51
7.4.90.0070.01116.28
7.4.80.0100.01019.39
7.4.70.0050.01516.45
7.4.60.0160.00016.45
7.4.50.0030.00616.53
7.4.40.0040.00822.77
7.4.30.0120.00616.54
7.4.00.0060.00914.54
7.3.330.0060.00013.23
7.3.320.0030.00313.38
7.3.310.0030.00616.29
7.3.300.0060.00016.37
7.3.290.0110.00316.43
7.3.280.0050.01016.36
7.3.270.0030.01317.40
7.3.260.0120.00818.24
7.3.250.0100.00716.53
7.3.240.0150.00316.62
7.3.230.0090.00916.44
7.3.210.0090.00916.67
7.3.200.0090.01219.39
7.3.190.0100.00716.39
7.3.180.0130.00416.27
7.3.170.0120.01016.70
7.3.160.0060.00916.33
7.3.120.0070.01115.04
7.3.10.0090.00316.88
7.3.00.0030.01016.71
7.2.330.0080.00816.71
7.2.320.0070.01116.52
7.2.310.0100.01116.72
7.2.300.0150.00616.69
7.2.290.0060.01016.77
7.2.130.0100.00717.03
7.2.120.0130.00516.45
7.2.110.0040.00816.46
7.2.100.0090.00716.83
7.2.90.0120.00416.80
7.2.80.0110.00216.92
7.2.70.0060.00916.80
7.2.60.0080.00516.88
7.2.50.0080.00516.97
7.2.40.0090.00717.04
7.2.30.0110.00517.01
7.2.20.0110.00516.87
7.2.10.0120.00616.74
7.2.00.0040.01117.62
7.1.250.0070.00715.88
7.1.240.0110.00715.80
7.1.230.0080.00815.79
7.1.220.0130.00015.94
7.1.210.0130.00415.70
7.1.200.0090.01115.78
7.1.190.0120.00415.74
7.1.180.0110.00815.78
7.1.170.0100.00515.62
7.1.160.0140.00315.89
7.1.150.0120.00615.56
7.1.140.0090.00315.73
7.1.130.0060.01115.95
7.1.120.0070.00715.48
7.1.110.0090.00615.78
7.1.100.0050.00916.99
7.1.90.0150.00415.82
7.1.80.0110.00615.92
7.1.70.0150.00016.50
7.1.60.0080.01017.54
7.1.50.0160.00816.35
7.1.40.0060.00915.87
7.1.30.0120.00315.57
7.1.20.0140.00315.86
7.1.10.0110.00415.77
7.1.00.0100.03718.96
7.0.320.0170.00015.36
7.0.310.0120.00815.35
7.0.300.0100.00715.29
7.0.290.0110.00515.36
7.0.280.0110.00315.20
7.0.270.0040.01115.20
7.0.260.0140.00515.29
7.0.250.0160.00015.42
7.0.240.0110.00615.53
7.0.230.0100.00315.50
7.0.220.0100.00715.38
7.0.210.0090.00315.52
7.0.200.0050.00816.22
7.0.190.0090.00615.55
7.0.180.0170.00315.48
7.0.170.0080.00415.36
7.0.160.0130.00315.63
7.0.150.0040.00815.28
7.0.140.0070.03618.80
7.0.130.0130.00315.34
7.0.120.0130.00315.56
7.0.110.0150.00015.38
7.0.100.0150.02317.76
7.0.90.0130.03917.73
7.0.80.0150.03217.59
7.0.70.0120.02717.70
7.0.60.0170.03517.69
7.0.50.0110.03517.73
7.0.40.0090.04216.72
7.0.30.0050.02716.87
7.0.20.0090.04516.79
7.0.10.0100.02316.78
7.0.00.0070.05016.78
5.6.380.0080.00814.23
5.6.370.0060.01014.40
5.6.360.0050.01014.63
5.6.350.0060.00914.31
5.6.340.0150.00414.34
5.6.330.0100.01014.55
5.6.320.0150.00014.07
5.6.310.0150.00014.16
5.6.300.0050.00814.15
5.6.290.0040.00914.55
5.6.280.0090.03717.63
5.6.270.0060.01114.44
5.6.260.0120.00614.37
5.6.250.0040.03617.35
5.6.240.0030.04917.46
5.6.230.0070.04317.50
5.6.220.0120.03217.47
5.6.210.0060.04517.57
5.6.200.0050.02917.73
5.6.190.0100.03817.72
5.6.180.0070.03717.79
5.6.170.0160.04017.63
5.6.160.0020.04617.83
5.6.150.0100.04217.83
5.6.140.0080.03517.79
5.6.130.0070.03017.67
5.6.120.0040.02917.71
5.6.110.0070.03717.56
5.6.100.0060.02317.64
5.6.90.0040.03417.71
5.6.80.0080.04117.41
5.6.70.0060.02817.22
5.6.60.0070.03017.25
5.6.50.0040.03717.46
5.6.40.0070.01817.38
5.6.30.0050.02817.32
5.6.20.0120.03517.35
5.6.10.0040.04217.30
5.6.00.0050.02917.37
5.5.380.0050.02416.03
5.5.370.0120.03416.02
5.5.360.0070.04516.05
5.5.350.0110.02316.03
5.5.340.0050.04316.18
5.5.330.0070.04316.18
5.5.320.0120.04216.20
5.5.310.0120.04216.22
5.5.300.0110.02516.11
5.5.290.0080.03816.18
5.5.280.0160.03716.23
5.5.270.0080.04216.11
5.5.260.0020.03716.15
5.5.250.0080.04616.14
5.5.240.0100.01815.87
5.5.230.0070.02215.95
5.5.220.0070.02615.88
5.5.210.0070.03415.89
5.5.200.0080.02615.85
5.5.190.0100.02415.91
5.5.180.0110.03515.87
5.5.170.0080.00414.05
5.5.160.0110.03015.93
5.5.150.0130.04215.86
5.5.140.0130.03715.86
5.5.130.0070.04015.91
5.5.120.0020.02915.90
5.5.110.0080.03315.90
5.5.100.0080.04015.83
5.5.90.0050.03015.87
5.5.80.0070.02215.83
5.5.70.0070.02315.81
5.5.60.0080.03215.84
5.5.50.0100.02415.83
5.5.40.0030.03015.84
5.5.30.0050.04015.81
5.5.20.0090.02715.82
5.5.10.0040.02715.86
5.5.00.0120.03315.79
5.4.450.0110.03615.53
5.4.440.0030.02615.58
5.4.430.0080.03915.40
5.4.420.0040.03215.52
5.4.410.0070.03215.46
5.4.400.0080.03315.41
5.4.390.0000.04215.40
5.4.380.0060.03315.41
5.4.370.0050.03415.38
5.4.360.0070.02015.32
5.4.350.0080.02815.24
5.4.340.0110.03315.36
5.4.330.0060.00311.58
5.4.320.0070.02815.40
5.4.310.0080.02515.41
5.4.300.0050.02615.24
5.4.290.0120.03815.31
5.4.280.0050.03715.41
5.4.270.0050.03215.39
5.4.260.0070.03615.39
5.4.250.0070.03815.31
5.4.240.0080.02815.25
5.4.230.0070.03915.41
5.4.220.0090.03115.37
5.4.210.0100.01815.30
5.4.200.0060.02815.35
5.4.190.0060.02215.35
5.4.180.0100.03715.39
5.4.170.0070.03315.31
5.4.160.0070.02515.35
5.4.150.0080.02215.35
5.4.140.0080.02914.01
5.4.130.0020.02713.96
5.4.120.0050.04113.99
5.4.110.0050.02213.96
5.4.100.0120.02914.02
5.4.90.0090.03714.01
5.4.80.0020.03413.99
5.4.70.0090.03113.98
5.4.60.0080.03613.96
5.4.50.0080.03514.03
5.4.40.0090.03814.02
5.4.30.0060.03914.03
5.4.20.0050.03313.99
5.4.10.0110.03313.96
5.4.00.0070.02213.79
5.3.290.0070.03013.12
5.3.280.0080.02313.10
5.3.270.0030.03813.06
5.3.260.0040.02013.10
5.3.250.0080.03313.17
5.3.240.0110.03313.07
5.3.230.0000.03813.07
5.3.220.0060.01913.06
5.3.210.0050.03413.11
5.3.200.0040.03813.08
5.3.190.0060.03513.07
5.3.180.0070.03013.08
5.3.170.0040.04013.13
5.3.160.0070.02313.12
5.3.150.0040.02313.09
5.3.140.0070.04113.07
5.3.130.0070.04013.13
5.3.120.0100.02613.13
5.3.110.0090.02313.12
5.3.100.0050.03812.86
5.3.90.0090.03312.84
5.3.80.0100.03712.76
5.3.70.0080.02212.83
5.3.60.0090.03012.75
5.3.50.0040.03212.82
5.3.40.0070.02612.78
5.3.30.0100.03312.71
5.3.20.0080.02812.65
5.3.10.0050.04212.62
5.3.00.0030.03912.55
5.2.170.0040.02011.32
5.2.160.0090.02511.34
5.2.150.0030.01811.37
5.2.140.0030.01811.33
5.2.130.0050.01811.40
5.2.120.0040.01911.37
5.2.110.0120.01711.37
5.2.100.0050.02711.30
5.2.90.0050.02011.40
5.2.80.0050.03211.35
5.2.70.0060.03511.35
5.2.60.0020.02211.38
5.2.50.0080.03411.23
5.2.40.0040.01811.22
5.2.30.0100.02811.29
5.2.20.0040.03611.23
5.2.10.0070.03011.29
5.2.00.0060.01711.12
5.1.60.0050.01710.84
5.1.50.0070.02510.80
5.1.40.0050.02710.78
5.1.30.0060.02811.03
5.1.20.0050.01911.03
5.1.10.0060.01610.82
5.1.00.0000.02610.77
5.0.50.0020.01910.09
5.0.40.0040.02010.03
5.0.30.0020.0309.95
5.0.20.0020.0129.93
5.0.10.0030.0169.90
5.0.00.0040.0219.94
4.4.90.0030.0169.82
4.4.80.0000.0129.82
4.4.70.0000.0189.82
4.4.60.0000.0229.82
4.4.50.0000.0219.82
4.4.40.0040.0289.82
4.4.30.0020.0129.82
4.4.20.0080.0129.82
4.4.10.0050.0189.82
4.4.00.0020.0189.82
4.3.110.0020.0109.82
4.3.100.0030.0109.82
4.3.90.0020.0209.82
4.3.80.0010.0189.82
4.3.70.0060.0139.82
4.3.60.0020.0119.82
4.3.50.0070.0129.82
4.3.40.0030.0269.82
4.3.30.0020.0189.82
4.3.20.0010.0119.82
4.3.10.0010.0149.82
4.3.00.0040.0139.82

preferences:
43.79 ms | 400 KiB | 5 Q