3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { echo 'In generator func foo',"\n"; for ($i = 11,$times=0; $i < 14; $i++,$times++) { $string=(yield $i); $times++; if (isset($string)) { echo $string,"\n"; } } echo $times,'generator done and closed.',"\n"; return; } $generator = foo(); foreach ($generator as $value) { if ($value == 13) { $generator->send('Hello World'); } echo "$value\n"; }

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.70.0130.00918.56
8.3.60.0060.00916.75
8.3.50.0130.00821.90
8.3.40.0070.00718.76
8.3.30.0100.00719.09
8.3.20.0040.00420.42
8.3.10.0040.00423.61
8.3.00.0080.00020.65
8.2.180.0110.00416.38
8.2.170.0060.01222.96
8.2.160.0100.00322.12
8.2.150.0080.00024.18
8.2.140.0070.00724.66
8.2.130.0000.00726.16
8.2.120.0070.00720.87
8.2.110.0070.00420.99
8.2.100.0090.00317.91
8.2.90.0060.00319.22
8.2.80.0040.00417.97
8.2.70.0030.00617.63
8.2.60.0040.00717.80
8.2.50.0080.00018.10
8.2.40.0040.00420.42
8.2.30.0050.00218.09
8.2.20.0070.00017.53
8.2.10.0070.00017.74
8.2.00.0000.00817.68
8.1.280.0100.00325.92
8.1.270.0080.00023.81
8.1.260.0090.00626.35
8.1.250.0080.00028.09
8.1.240.0060.00322.11
8.1.230.0090.00317.71
8.1.220.0000.00817.74
8.1.210.0030.00518.77
8.1.200.0060.00317.35
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0060.00318.57
8.1.160.0070.00022.01
8.1.150.0040.00418.64
8.1.140.0040.00417.43
8.1.130.0040.00417.87
8.1.120.0040.00417.53
8.1.110.0000.00817.45
8.1.100.0040.00417.48
8.1.90.0080.00017.43
8.1.80.0000.00817.46
8.1.70.0030.00317.29
8.1.60.0050.00317.59
8.1.50.0030.00617.43
8.1.40.0030.00517.50
8.1.30.0040.00417.49
8.1.20.0000.00717.54
8.1.10.0040.00417.53
8.1.00.0040.00417.42
8.0.300.0070.00318.77
8.0.290.0040.00416.63
8.0.280.0040.00418.38
8.0.270.0000.00717.31
8.0.260.0060.00016.73
8.0.250.0000.00716.86
8.0.240.0050.00316.95
8.0.230.0000.00716.95
8.0.220.0000.00716.88
8.0.210.0030.00316.82
8.0.200.0060.00016.93
8.0.190.0040.00416.94
8.0.180.0040.00416.78
8.0.170.0040.00416.80
8.0.160.0040.00416.97
8.0.150.0000.00816.83
8.0.140.0040.00416.80
8.0.130.0000.00513.41
8.0.120.0040.00416.91
8.0.110.0080.00016.91
8.0.100.0040.00416.86
8.0.90.0040.00416.72
8.0.80.0080.00816.93
8.0.70.0080.00016.67
8.0.60.0080.00016.71
8.0.50.0080.00016.85
8.0.30.0140.00917.11
8.0.20.0090.01017.40
8.0.10.0000.00717.07
8.0.00.0120.00816.84
7.4.330.0030.00315.00
7.4.320.0030.00316.64
7.4.300.0000.00616.40
7.4.290.0040.00416.56
7.4.280.0070.00016.50
7.4.270.0070.00016.50
7.4.260.0070.00016.38
7.4.250.0040.00416.46
7.4.240.0030.00316.58
7.4.230.0000.00816.70
7.4.220.0140.00516.57
7.4.210.0040.01216.59
7.4.200.0030.00316.33
7.4.190.0000.00716.67
7.4.160.0120.00916.30
7.4.150.0090.00917.40
7.4.140.0080.00817.86
7.4.130.0110.00616.49
7.4.120.0050.01316.59
7.4.110.0000.01716.66
7.4.100.0110.00816.42
7.4.90.0060.01216.70
7.4.80.0110.00716.63
7.4.70.0060.01316.59
7.4.60.0110.00416.51
7.4.50.0000.00616.28
7.4.40.0060.00622.77
7.4.30.0070.01516.50
7.4.00.0040.01115.17
7.3.330.0020.00213.35
7.3.320.0060.00013.31
7.3.310.0030.00316.43
7.3.300.0030.00316.37
7.3.290.0110.00316.38
7.3.280.0040.01216.35
7.3.270.0170.00717.40
7.3.260.0060.01116.66
7.3.250.0100.00916.39
7.3.240.0080.00816.42
7.3.230.0040.01216.42
7.3.210.0120.00616.58
7.3.200.0090.00919.39
7.3.190.0080.01116.73
7.3.180.0130.00716.57
7.3.170.0190.00016.38
7.3.160.0060.00916.48
7.3.120.0060.01014.84
7.2.330.0120.00616.60
7.2.320.0060.01616.73
7.2.310.0100.00716.80
7.2.300.0040.01516.68
7.2.290.0100.00716.73
7.2.60.0140.00016.81
7.2.00.0030.00619.37
7.1.200.0060.00615.79
7.1.100.0040.00718.21
7.1.70.0030.00617.21
7.1.60.0080.01519.29
7.1.50.0090.01316.91
7.1.00.0070.07322.35
7.0.200.0050.00316.44
7.0.140.0030.07322.12
7.0.60.0030.08319.83
7.0.50.0300.04017.93
7.0.40.0100.09020.20
7.0.30.0270.03320.11
7.0.20.0270.07720.21
7.0.10.0070.04020.24
7.0.00.0070.04020.25
5.6.280.0030.07321.10
5.6.210.0030.04020.51
5.6.200.0200.06718.20
5.6.190.0070.04320.55
5.6.180.0270.05020.33
5.6.170.0270.06720.50
5.6.160.0000.08720.52
5.6.150.0070.07318.25
5.6.140.0070.07718.18
5.6.130.0130.07018.18
5.6.120.0070.08320.97
5.6.110.0100.08321.01
5.6.100.0170.08321.14
5.6.90.0070.08720.99
5.6.80.0070.03320.52
5.5.350.0000.08320.45
5.5.340.0030.04317.96
5.5.330.0100.05320.28
5.5.320.0000.04320.20
5.5.310.0370.07320.27
5.5.300.0030.03717.95
5.5.290.0030.04717.98
5.5.280.0130.07320.72
5.5.270.0100.03720.64
5.5.260.0100.08020.79
5.5.250.0130.07720.66
5.5.240.0300.06720.27
5.4.450.0370.05719.47
5.4.440.0830.05719.57
5.4.430.1030.06019.16
5.4.420.0600.05719.60
5.4.410.0770.06019.35
5.4.400.0770.05019.29
5.4.390.0770.04718.84
5.4.380.0230.04318.73
5.4.370.0200.05018.56
5.4.360.0200.04718.69
5.4.350.0200.05718.78
5.4.340.0170.05018.73
5.4.320.0060.03612.52
5.4.310.0050.03912.52
5.4.300.0080.03712.52
5.4.290.0110.03312.52
5.4.280.0050.03612.41
5.4.270.0070.03512.41
5.4.260.0060.03712.41
5.4.250.0030.04512.41
5.4.240.0070.03512.41
5.4.230.0090.04312.40
5.4.220.0190.04012.38
5.4.210.0160.04212.38
5.4.200.0150.04512.38
5.4.190.0160.04312.38
5.4.180.0160.04312.38
5.4.170.0160.04312.39
5.4.160.0150.04612.38
5.4.150.0200.04312.38
5.4.140.0160.04712.07
5.4.130.0140.04912.05
5.4.120.0170.04012.02
5.4.110.0220.03712.02
5.4.100.0160.04512.02
5.4.90.0140.04412.02
5.4.80.0170.04512.02
5.4.70.0170.04012.02
5.4.60.0190.04212.02
5.4.50.0170.04412.01
5.4.40.0150.04512.00
5.4.30.0150.04512.00
5.4.20.0160.04411.99
5.4.10.0200.03912.00
5.4.00.0170.04011.49
5.3.290.0030.04212.80
5.3.280.0080.03812.71
5.3.270.0180.04412.73
5.3.260.0120.05112.72
5.3.250.0270.06312.72
5.3.240.0180.04512.72
5.3.230.0160.04512.71
5.3.220.0280.06312.68
5.3.210.0200.04812.68
5.3.200.0150.04812.68
5.3.190.0210.04412.68
5.3.180.0150.04512.67
5.3.170.0150.04512.67
5.3.160.0190.04212.67
5.3.150.0190.04512.68
5.3.140.0180.04512.66
5.3.130.0140.04612.66
5.3.120.0170.04412.66
5.3.110.0190.04512.66
5.3.100.0140.04612.12
5.3.90.0140.04412.09
5.3.80.0340.08912.08
5.3.70.0150.04512.07
5.3.60.0140.04612.06
5.3.50.0190.04312.00
5.3.40.0190.04412.00
5.3.30.0120.05011.97
5.3.20.0200.04111.75
5.3.10.0160.04311.71
5.3.00.0230.06411.69
5.2.170.0130.0349.20
5.2.160.0180.0329.20
5.2.150.0110.0379.20
5.2.140.0100.0389.20
5.2.130.0070.0409.16
5.2.120.0200.0319.16
5.2.110.0150.0359.16
5.2.100.0320.0809.16
5.2.90.0110.0389.16
5.2.80.0120.0399.14
5.2.70.0130.0429.15
5.2.60.0330.1079.11
5.2.50.0130.0389.07
5.2.40.0110.0409.05
5.2.30.0250.0529.02
5.2.20.0140.0339.02
5.2.10.0090.0378.93
5.2.00.0120.0348.77
5.1.60.0130.0268.06
5.1.50.0160.0568.06
5.1.40.0130.0288.05
5.1.30.0150.0288.39
5.1.20.0100.0348.43
5.1.10.0140.0298.14
5.1.00.0150.0288.14
5.0.50.0100.0246.63
5.0.40.0070.0266.48
5.0.30.0080.0376.30
5.0.20.0080.0256.26
5.0.10.0120.0226.23
5.0.00.0090.0396.23
4.4.90.0060.0204.78
4.4.80.0070.0184.75
4.4.70.0040.0234.76
4.4.60.0080.0174.75
4.4.50.0080.0174.77
4.4.40.0080.0294.71
4.4.30.0100.0154.76
4.4.20.0070.0184.85
4.4.10.0100.0154.85
4.4.00.0050.0304.76
4.3.110.0060.0184.67
4.3.100.0060.0184.66
4.3.90.0170.0384.63
4.3.80.0080.0264.58
4.3.70.0070.0174.63
4.3.60.0170.0374.63
4.3.50.0080.0174.63
4.3.40.0080.0274.54
4.3.30.0040.0193.30
4.3.20.0070.0193.28
4.3.10.0080.0183.25
4.3.00.0070.0176.94

preferences:
49.36 ms | 401 KiB | 5 Q