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) { echo $g; if ($gen->current() == 4) { $gen->send("\n999\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.40.0040.01218.65
8.3.30.0070.00720.13
8.3.20.0060.00320.39
8.3.10.0030.00521.10
8.3.00.0040.00423.48
8.2.170.0090.00922.96
8.2.160.0030.01020.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0040.00421.03
8.2.110.0060.00319.38
8.2.100.0100.00017.78
8.2.90.0060.00619.17
8.2.80.0030.00619.42
8.2.70.0060.00317.38
8.2.60.0030.00517.93
8.2.50.0040.00418.07
8.2.40.0030.00518.34
8.2.30.0000.00719.45
8.2.20.0040.00417.62
8.2.10.0000.00717.57
8.2.00.0060.00317.58
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00322.45
8.1.230.0080.00321.03
8.1.220.0030.00518.77
8.1.210.0000.00819.04
8.1.200.0060.00317.36
8.1.190.0040.00417.52
8.1.180.0000.00818.10
8.1.170.0040.00418.59
8.1.160.0040.00418.98
8.1.150.0040.00418.55
8.1.140.0040.00417.52
8.1.130.0030.00317.88
8.1.120.0040.00417.36
8.1.110.0030.00517.35
8.1.100.0040.00417.44
8.1.90.0040.00417.39
8.1.80.0040.00417.46
8.1.70.0000.00717.43
8.1.60.0090.00017.62
8.1.50.0000.00717.35
8.1.40.0080.00017.59
8.1.30.0040.00417.55
8.1.20.0000.00817.64
8.1.10.0050.00317.38
8.1.00.0070.00017.41
8.0.300.0030.00319.97
8.0.290.0070.00017.15
8.0.280.0030.00318.36
8.0.270.0030.00317.25
8.0.260.0070.00016.73
8.0.250.0000.00816.96
8.0.240.0040.00417.00
8.0.230.0000.00716.98
8.0.220.0040.00416.77
8.0.210.0070.00016.79
8.0.200.0000.00716.96
8.0.190.0040.00416.86
8.0.180.0070.00016.98
8.0.170.0000.00816.93
8.0.160.0000.00716.88
8.0.150.0070.00016.84
8.0.140.0040.00416.88
8.0.130.0000.00813.36
8.0.120.0000.00716.87
8.0.110.0030.00516.93
8.0.100.0000.00716.93
8.0.90.0070.00016.71
8.0.80.0120.00316.91
8.0.70.0050.00316.84
8.0.60.0030.00516.86
8.0.50.0000.00716.78
8.0.30.0090.00917.00
8.0.20.0130.00617.40
8.0.10.0070.00016.82
8.0.00.0080.01016.73
7.4.330.0020.00215.04
7.4.320.0060.00316.45
7.4.300.0030.00316.51
7.4.290.0060.00316.52
7.4.280.0070.00016.50
7.4.270.0000.00716.52
7.4.260.0030.00313.30
7.4.250.0050.00316.46
7.4.240.0040.00416.55
7.4.230.0000.00716.63
7.4.220.0130.01016.50
7.4.210.0100.00416.62
7.4.200.0000.00716.68
7.4.190.0070.00016.57
7.4.160.0060.01016.45
7.4.150.0130.00317.40
7.4.140.0160.01917.86
7.4.130.0090.00816.61
7.4.120.0040.01316.51
7.4.110.0070.01016.52
7.4.100.0200.00016.51
7.4.90.0070.01116.46
7.4.80.0090.01219.39
7.4.70.0130.00316.21
7.4.60.0090.00616.39
7.4.50.0040.00416.30
7.4.40.0110.00422.77
7.4.30.0150.00316.44
7.4.00.0100.00614.92
7.3.330.0050.00013.14
7.3.320.0000.00613.32
7.3.310.0040.00416.22
7.3.300.0070.00016.30
7.3.290.0080.00816.37
7.3.280.0060.00916.38
7.3.270.0130.00317.40
7.3.260.0090.01218.24
7.3.250.0120.00616.52
7.3.240.0150.00316.50
7.3.230.0140.00716.39
7.3.210.0070.01116.65
7.3.200.0060.01219.39
7.3.190.0150.00616.48
7.3.180.0040.01516.38
7.3.170.0130.00316.34
7.3.160.0150.00916.46
7.3.120.0070.01014.90
7.3.110.0080.01014.76
7.3.100.0020.01614.71
7.3.90.0060.00815.01
7.3.80.0090.00214.97
7.3.70.0080.00614.64
7.3.60.0030.01214.63
7.3.50.0100.00314.93
7.3.40.0020.01014.82
7.3.30.0070.00714.71
7.3.20.0060.00816.72
7.3.10.0030.01016.64
7.3.00.0060.00916.65
7.2.330.0000.01716.86
7.2.320.0110.00716.64
7.2.310.0100.01016.95
7.2.300.0130.00616.65
7.2.290.0110.00616.58
7.2.250.0100.00815.21
7.2.240.0080.00815.01
7.2.230.0070.00615.27
7.2.220.0090.00714.99
7.2.210.0030.01015.10
7.2.200.0070.00715.14
7.2.190.0050.00715.09
7.2.180.0080.00615.16
7.2.170.0090.00715.16
7.2.160.0060.00915.22
7.2.150.0030.01216.89
7.2.140.0060.00617.02
7.2.130.0060.00516.77
7.2.120.0090.00516.92
7.2.110.0090.01116.88
7.2.100.0040.01016.99
7.2.90.0150.00616.72
7.2.80.0120.00416.88
7.2.70.0160.00716.95
7.2.60.0060.00916.83
7.2.50.0090.00816.85
7.2.40.0070.01216.93
7.2.30.0060.01317.03
7.2.20.0110.00516.82
7.2.10.0070.01016.80
7.2.00.0030.00917.84
7.1.330.0050.01115.85
7.1.320.0000.01115.97
7.1.310.0060.00916.04
7.1.300.0050.00815.86
7.1.290.0060.00915.86
7.1.280.0020.01115.76
7.1.270.0070.00715.62
7.1.260.0000.01415.72
7.1.250.0050.00615.88
7.1.240.0090.00615.61
7.1.230.0070.00715.80
7.1.220.0000.01315.75
7.1.210.0030.00816.03
7.1.200.0090.00415.72
7.1.190.0040.00815.84
7.1.180.0080.00315.79
7.1.170.0030.01315.54
7.1.160.0040.00715.89
7.1.150.0000.00915.61
7.1.140.0000.01215.80
7.1.130.0000.01115.97
7.1.120.0060.00615.82
7.1.110.0100.00315.96
7.1.100.0000.01016.89
7.1.90.0060.00915.79
7.1.80.0030.00615.84
7.1.70.0070.00416.55
7.1.60.0110.00817.42
7.1.50.0030.01616.33
7.1.40.0030.00615.62
7.1.30.0040.01115.85
7.1.20.0070.00715.55
7.1.10.0060.01015.93
7.1.00.0040.02619.08
7.0.330.0000.01115.51
7.0.320.0060.00315.39
7.0.310.0100.00615.41
7.0.300.0100.00715.45
7.0.290.0030.00715.36
7.0.280.0000.01115.25
7.0.270.0030.00715.45
7.0.260.0090.00315.15
7.0.250.0040.00815.54
7.0.240.0090.00315.38
7.0.230.0060.00615.34
7.0.220.0060.00315.33
7.0.210.0070.00715.59
7.0.200.0030.00916.07
7.0.190.0040.00915.47
7.0.180.0000.01115.58
7.0.170.0030.00715.61
7.0.160.0100.00315.48
7.0.150.0030.01215.48
7.0.140.0060.03618.75
7.0.130.0000.01515.34
7.0.120.0110.00015.32
7.0.110.0040.00815.45
7.0.100.0040.00715.15
7.0.90.0070.00715.47
7.0.80.0070.00715.60
7.0.70.0100.00315.16
7.0.60.0100.04017.72
7.0.50.0080.02116.75
7.0.40.0100.02316.90
7.0.30.0100.02716.83
7.0.20.0130.03016.78
7.0.10.0170.02816.75
7.0.00.0090.04216.81
5.6.400.0130.00014.04
5.6.390.0040.01114.29
5.6.380.0080.00514.61
5.6.370.0090.00014.70
5.6.360.0060.00314.27
5.6.350.0080.00414.14
5.6.340.0070.00714.48
5.6.330.0000.00814.24
5.6.320.0060.00614.67
5.6.310.0060.00914.61
5.6.300.0030.01014.33
5.6.290.0070.00714.25
5.6.280.0050.04217.68
5.6.270.0030.01014.30
5.6.260.0060.00614.29
5.6.250.0070.00414.31
5.6.240.0070.01014.30
5.6.230.0000.01114.53
5.6.220.0070.00714.26
5.6.210.0110.02617.46
5.6.200.0050.02516.29
5.6.190.0070.04417.28
5.6.180.0180.03317.39
5.6.170.0290.03517.26
5.6.160.0120.02217.45
5.6.150.0000.04016.33
5.6.140.0080.04016.32
5.6.130.0100.02916.22
5.6.120.0100.03517.67
5.6.110.0080.04817.66
5.6.100.0070.03217.78
5.6.90.0100.04017.70
5.6.80.0080.02817.37
5.6.70.0170.03517.41
5.6.60.0000.00814.19
5.6.50.0000.01514.48
5.6.40.0100.00314.17
5.6.30.0030.00914.48
5.6.20.0090.00614.19
5.6.10.0070.00714.27
5.6.00.0030.00913.98
5.5.380.0000.01414.36
5.5.370.0030.01014.38
5.5.360.0030.00914.54
5.5.350.0200.04717.03
5.5.340.0030.04715.89
5.5.330.0080.02817.39
5.5.320.0050.02817.29
5.5.310.0130.03617.29
5.5.300.0110.02816.04
5.5.290.0050.03316.17
5.5.280.0090.01717.61
5.5.270.0080.03117.57
5.5.260.0060.04017.71
5.5.250.0070.04317.42
5.5.240.0150.03817.33
5.5.230.0040.01113.99
5.5.220.0060.00614.02
5.5.210.0060.00614.28
5.5.200.0000.01313.92
5.5.190.0000.01214.38
5.5.180.0110.00813.88
5.5.170.0060.00614.03
5.5.160.0140.00714.35
5.5.150.0030.01014.08
5.5.140.0040.01114.38
5.5.130.0000.01513.98
5.5.120.0040.01514.44
5.5.110.0120.00013.78
5.5.100.0030.00714.02
5.5.90.0040.00714.07
5.5.80.0080.00814.29
5.5.70.0030.01014.27
5.5.60.0000.01113.96
5.5.50.0130.00314.50
5.5.40.0050.00514.24
5.5.30.0120.00614.32
5.5.20.0040.00813.88
5.5.10.0100.00014.15
5.5.00.0000.01413.98
5.4.450.0760.02316.00
5.4.440.0800.02215.89
5.4.430.0840.01715.93
5.4.420.0780.01916.11
5.4.410.0530.02316.02
5.4.400.0050.02215.93
5.4.390.0020.03015.94
5.4.380.0460.02215.77
5.4.370.0780.02015.90
5.4.360.0700.02515.88
5.4.350.0840.02315.87
5.4.340.0820.01915.95
5.4.330.0000.01112.68
5.4.320.0940.02415.88
5.4.310.0780.01915.80
5.4.300.0720.02315.86
5.4.290.0850.02015.92
5.4.280.0770.01515.78
5.4.270.0800.02215.91
5.4.260.0800.02315.92
5.4.250.0810.02115.84
5.4.240.0070.02015.71
5.4.230.0020.02215.84
5.4.220.0400.02015.88
5.4.210.0750.02215.95
5.4.200.0820.01915.85
5.4.190.0930.02915.88
5.4.180.0930.02515.83
5.4.170.0920.02315.71
5.4.160.0800.01915.91
5.4.150.0920.02515.78
5.4.140.0800.02014.50
5.4.130.0950.02414.68
5.4.120.0770.02314.50
5.4.110.0440.02214.62
5.4.100.0070.02114.62
5.4.90.0000.02214.53
5.4.80.0550.02214.51
5.4.70.0950.02414.56
5.4.60.0900.02314.51
5.4.50.0820.02214.62
5.4.40.0700.02714.59
5.4.30.0850.02314.61
5.4.20.0850.02214.42
5.4.10.0760.02014.55
5.4.00.0800.02314.24
5.3.290.0790.02213.74
5.3.280.0700.02213.63
5.3.270.0850.02813.59
5.3.260.0720.02113.63
5.3.250.0880.02813.67
5.3.240.0750.02613.61
5.3.230.0900.02513.68
5.3.220.0730.02113.58
5.3.210.0880.02913.63
5.3.200.0940.02213.62
5.3.190.0940.02313.65
5.3.180.0780.02013.59
5.3.170.0820.02613.67
5.3.160.0830.03013.74
5.3.150.0910.01813.70
5.3.140.0590.02213.69
5.3.130.0060.02013.64
5.3.120.0030.04313.73
5.3.110.0650.02813.66
5.3.100.0900.02913.37
5.3.90.0900.02213.34
5.3.80.0730.02413.37
5.3.70.0860.02313.30
5.3.60.0890.02713.37
5.3.50.0800.02113.32
5.3.40.0870.02713.26
5.3.30.0840.01613.30
5.3.20.0820.02913.26
5.3.10.0770.02213.17
5.3.00.0770.03113.13
5.2.170.0030.06311.15
5.2.160.0130.05311.26
5.2.150.0000.03711.23
5.2.140.1200.03311.10
5.2.130.1270.02711.15
5.2.120.1530.02711.15
5.2.110.1200.03311.18
5.2.100.1570.02711.07
5.2.90.1300.02711.18
5.2.80.1500.03311.10
5.2.70.1470.03311.00
5.2.60.1300.03011.10
5.2.50.1270.03011.13
5.2.40.1530.04010.97
5.2.30.1000.03010.89
5.2.20.1300.03311.02
5.2.10.1030.04010.82
5.2.00.0030.02710.63
5.1.60.0070.04310.06
5.1.50.0100.0209.97
5.1.40.0330.0339.88
5.1.30.1030.03010.26
5.1.20.1270.03010.28
5.1.10.1230.0279.96
5.1.00.1030.02310.21
5.0.50.0570.0178.53
5.0.40.0530.0178.31
5.0.30.0670.0478.15
5.0.20.0530.0178.19
5.0.10.0730.0278.07
5.0.00.0530.0308.23
4.4.90.0500.0177.81
4.4.80.0670.0207.81
4.4.70.0670.0277.81
4.4.60.0630.0277.81
4.4.50.0570.0207.81
4.4.40.0500.0277.81
4.4.30.0600.0237.81
4.4.20.0500.0177.81
4.4.10.0730.0237.81
4.4.00.0570.0307.81
4.3.110.0200.0177.81
4.3.100.0000.0377.81
4.3.90.0000.0177.81
4.3.80.0000.0577.81
4.3.70.0030.0137.81
4.3.60.0030.0207.81
4.3.50.0030.0177.81
4.3.40.0000.0277.81
4.3.30.0130.0137.81
4.3.20.0270.0137.81
4.3.10.0370.0337.81
4.3.00.0230.0177.81

preferences:
45.64 ms | 400 KiB | 5 Q