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("\nmy lucky number is 999\n"); // injecting a value 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.60.0060.01216.74
8.3.50.0100.00817.30
8.3.40.0090.00618.65
8.3.30.0090.00618.45
8.3.20.0100.00718.65
8.3.10.0060.00320.39
8.3.00.0050.00319.25
8.2.180.0160.00616.48
8.2.170.0000.01422.96
8.2.160.0090.00618.91
8.2.150.0090.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0100.00721.12
8.2.110.0040.00419.40
8.2.100.0080.00317.72
8.2.90.0040.00419.19
8.2.80.0040.00419.41
8.2.70.0030.00617.63
8.2.60.0040.00417.80
8.2.50.0000.00818.07
8.2.40.0060.00318.28
8.2.30.0040.00418.04
8.2.20.0040.00817.53
8.2.10.0040.00417.74
8.2.00.0070.00017.68
8.1.280.0070.01425.92
8.1.270.0080.00023.99
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0080.00522.13
8.1.230.0100.00322.66
8.1.220.0000.00918.77
8.1.210.0020.00519.07
8.1.200.0060.00317.35
8.1.190.0000.00717.53
8.1.180.0000.00818.10
8.1.170.0040.00418.71
8.1.160.0040.00418.80
8.1.150.0070.00318.55
8.1.140.0060.00317.45
8.1.130.0030.00317.80
8.1.120.0000.00717.47
8.1.110.0060.00317.35
8.1.100.0000.00717.52
8.1.90.0000.00817.36
8.1.80.0070.00017.53
8.1.70.0030.00317.44
8.1.60.0080.00017.55
8.1.50.0000.00817.50
8.1.40.0000.00717.41
8.1.30.0040.00417.63
8.1.20.0040.00417.62
8.1.10.0000.00817.51
8.1.00.0000.00817.31
8.0.300.0070.00019.94
8.0.290.0000.00716.75
8.0.280.0000.00918.44
8.0.270.0070.00017.23
8.0.260.0030.00318.43
8.0.250.0050.00317.02
8.0.240.0030.00616.97
8.0.230.0030.00316.95
8.0.220.0070.00016.93
8.0.210.0000.00816.91
8.0.200.0070.00016.95
8.0.190.0070.00016.95
8.0.180.0030.00316.93
8.0.170.0000.00816.78
8.0.160.0000.00816.92
8.0.150.0000.00816.75
8.0.140.0080.00316.82
8.0.130.0050.00013.36
8.0.120.0070.00316.87
8.0.110.0040.00416.78
8.0.100.0040.00416.84
8.0.90.0040.00416.88
8.0.80.0070.00716.82
8.0.70.0000.00716.84
8.0.60.0040.00416.86
8.0.50.0030.00416.92
8.0.30.0150.00317.11
8.0.20.0100.01117.16
8.0.10.0000.00716.81
8.0.00.0150.00916.67
7.4.330.0030.00313.06
7.4.320.0000.00616.51
7.4.300.0030.00316.36
7.4.290.0040.00416.41
7.4.280.0040.00416.59
7.4.270.0040.00416.53
7.4.260.0030.00313.27
7.4.250.0030.00616.50
7.4.240.0040.00416.52
7.4.230.0030.00316.63
7.4.220.0090.00916.65
7.4.210.0060.00916.49
7.4.200.0030.00316.71
7.4.190.0000.00716.70
7.4.160.0100.00716.55
7.4.150.0120.00916.37
7.4.140.0070.01016.52
7.4.130.0110.00716.48
7.4.120.0070.01016.54
7.4.110.0030.01416.54
7.4.100.0090.01216.68
7.4.90.0110.00716.49
7.4.80.0130.00419.39
7.4.70.0060.01316.59
7.4.60.0040.01216.46
7.4.50.0040.00416.24
7.4.40.0100.00616.38
7.4.30.0030.01316.41
7.4.00.0090.00615.14
7.3.330.0000.00613.19
7.3.320.0030.00513.34
7.3.310.0030.00316.26
7.3.300.0000.00816.41
7.3.290.0060.00816.36
7.3.280.0050.01616.39
7.3.270.0110.01116.49
7.3.260.0130.00616.57
7.3.250.0100.00816.36
7.3.240.0040.01216.36
7.3.230.0150.00716.38
7.3.210.0140.00416.55
7.3.200.0070.01016.41
7.3.190.0120.00916.68
7.3.180.0050.01016.31
7.3.170.0130.00316.42
7.3.160.0090.00616.33
7.3.120.0070.00715.15
7.2.330.0120.00816.56
7.2.320.0170.01216.77
7.2.310.0100.00716.81
7.2.300.0120.00416.81
7.2.290.0040.01216.75
7.2.00.0000.01219.67
7.1.200.0040.00415.89
7.1.70.0000.00817.19
7.1.60.0030.01217.17
7.1.50.0130.00317.11
7.1.00.0000.03722.35
7.0.200.0040.00716.86
7.0.140.0070.07021.95
7.0.120.0030.07322.09
7.0.60.0030.04319.94
7.0.50.0070.08317.74
7.0.40.0300.03720.21
7.0.30.0300.04320.24
7.0.20.0230.05720.20
7.0.10.0370.07720.14
7.0.00.0400.07020.23
5.6.280.0000.07720.85
5.6.210.0070.05020.61
5.6.200.0070.04318.15
5.6.190.0230.06320.45
5.6.180.0300.04320.57
5.6.170.0270.04720.42
5.6.160.0330.06720.64
5.6.150.0400.07320.43
5.6.140.0330.07320.23
5.6.130.0330.08320.36
5.6.120.0370.05720.50
5.6.110.0270.04020.17
5.6.100.0230.04720.32
5.6.90.0330.08020.21
5.6.80.0300.04019.71
5.6.70.0270.08019.87
5.6.60.0230.03719.75
5.6.50.0200.04019.73
5.6.40.0200.03719.88
5.6.30.0230.03719.60
5.6.20.0230.03719.76
5.6.10.0200.04019.55
5.6.00.0200.03719.72
5.5.350.0000.05020.34
5.5.340.0100.04717.92
5.5.330.0330.06320.41
5.5.320.0230.04020.14
5.5.310.0230.05020.13
5.5.300.0330.04020.33
5.5.290.0330.05720.30
5.5.280.0300.07020.22
5.5.270.0430.06320.23
5.5.260.0270.04320.31
5.5.250.0230.05019.98
5.5.240.0370.07019.42
5.5.230.0230.04319.50
5.5.220.0330.04019.62
5.5.210.0200.04319.37
5.5.200.0200.03719.58
5.5.190.0270.03019.56
5.5.180.0130.04319.55
5.5.160.0170.04319.58
5.5.150.0230.04319.55
5.5.140.0270.03719.32
5.5.130.0200.04019.64
5.5.120.0130.04319.32
5.5.110.0370.03019.52
5.5.100.0200.03719.29
5.5.90.0200.04019.23
5.5.80.0130.04719.21
5.5.70.0200.03719.39
5.5.60.0300.03719.36
5.5.50.0230.03719.23
5.5.40.0230.04319.46
5.5.30.0200.03719.27
5.5.20.0200.03719.33
5.5.10.0130.04319.28
5.5.00.0100.04719.42
5.4.450.0300.06719.31
5.4.440.0300.05019.40
5.4.430.0300.03719.57
5.4.420.0370.05319.40
5.4.410.0300.03319.17
5.4.400.0370.06019.15
5.4.390.0230.07319.25
5.4.380.0230.03719.25
5.4.370.0230.03319.00
5.4.360.0130.04319.00
5.4.350.0270.02719.15
5.4.340.0170.04019.15
5.4.320.0130.05019.21
5.4.310.0200.04018.86
5.4.300.0170.05719.07
5.4.290.0300.06719.16
5.4.280.0130.05318.98
5.4.270.0270.03018.85
5.4.260.0230.03719.20
5.4.250.0230.03319.11
5.4.240.0170.04019.14
5.4.230.0230.03319.11
5.4.220.0130.04319.14
5.4.210.0170.03718.85
5.4.200.0230.03319.00
5.4.190.0170.03719.11
5.4.180.0200.03318.93
5.4.170.0200.03319.16
5.4.160.0170.04018.96
5.4.150.0130.04319.02
5.4.140.0130.04016.54
5.4.130.0200.03316.41
5.4.120.0200.03716.34
5.4.110.0230.03716.29
5.4.100.0230.03716.39
5.4.90.0200.04716.43
5.4.80.0200.05716.44
5.4.70.0200.06016.42
5.4.60.0270.07316.30
5.4.50.0330.05716.36
5.4.40.0300.06716.40
5.4.30.0370.06016.26
5.4.20.0270.03016.27
5.4.10.0270.07016.40
5.4.00.0270.05315.73
5.3.290.0200.04014.71
5.3.280.0230.03314.48
5.3.270.0170.03714.60
5.3.260.0200.03314.61
5.3.250.0170.03714.63
5.3.240.0130.04014.75
5.3.230.0200.05314.61
5.3.220.0230.07714.59
5.3.210.0400.06014.58
5.3.200.0170.04014.48
5.3.190.0370.06314.57
5.3.180.0300.05014.64
5.3.170.0300.07314.57
5.3.160.0330.06014.64
5.3.150.0230.04014.62
5.3.140.0230.04714.60
5.3.130.0230.04014.54
5.3.120.0330.02714.55
5.3.110.0270.03314.70
5.3.100.0200.04313.96
5.3.90.0230.03714.02
5.3.80.0270.07314.04
5.3.70.0270.04713.98
5.3.60.0300.07014.15
5.3.50.0230.06313.98
5.3.40.0330.07013.99
5.3.30.0430.03314.06
5.3.20.0230.05013.84
5.3.10.0270.03713.66
5.3.00.0330.06313.56
5.2.170.0270.05313.29
5.2.160.0270.05013.29
5.2.150.0270.04013.29
5.2.140.0270.04713.29
5.2.130.0270.05713.29
5.2.120.0330.05013.29
5.2.110.0330.05013.29
5.2.100.0270.05313.29
5.2.90.0230.06013.29
5.2.80.0200.05013.29
5.2.70.0230.03013.29
5.2.60.0270.03713.29
5.2.50.0230.02713.29
5.2.40.0200.02713.29
5.2.30.0370.04013.29
5.2.20.0330.04713.29
5.2.10.0230.04013.29
5.2.00.0200.05713.29
5.1.60.0130.02713.29
5.1.50.0200.02713.29
5.1.40.0170.03713.29
5.1.30.0200.05013.29
5.1.20.0270.02313.29
5.1.10.0170.03313.29
5.1.00.0200.05013.29
5.0.50.0100.03713.29
5.0.40.0130.03713.29
5.0.30.0100.03713.29
5.0.20.0100.02713.29
5.0.10.0070.02713.29
5.0.00.0100.03013.29
4.4.90.0130.03013.29
4.4.80.0100.01313.29
4.4.70.0100.03313.29
4.4.60.0100.03313.29
4.4.50.0130.03313.29
4.4.40.0070.03013.29
4.4.30.0130.01713.29
4.4.20.0100.02713.29
4.4.10.0100.03313.29
4.4.00.0100.05313.29
4.3.110.0130.02313.29
4.3.100.0100.02013.29
4.3.90.0100.02313.29
4.3.80.0070.03013.29
4.3.70.0100.01313.29
4.3.60.0100.01313.29
4.3.50.0100.01713.29
4.3.40.0070.02313.29
4.3.30.0100.03013.29
4.3.20.0030.03713.29
4.3.10.0070.02713.29
4.3.00.0070.02713.29

preferences:
60.59 ms | 401 KiB | 5 Q