3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen1() { yield 1; yield 2; yield 3; } function yf($iter) { $isSubgenerator = $iter instanceof Generator; foreach($iter as $val) { $x = yield $val; echo "Got $x from a yieldn\n"; } } $g = yf(gen1()); $g->next(); var_dump($g->current()); $g->send(10); var_dump($g->current()); $g->send(20); var_dump($g->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.0110.00416.72
8.3.50.0120.00521.09
8.3.40.0110.00718.80
8.3.30.0060.00918.68
8.3.20.0050.00220.39
8.3.10.0050.00223.61
8.3.00.0000.00819.46
8.2.180.0110.00418.29
8.2.170.0110.00422.96
8.2.160.0140.00320.45
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0030.00617.36
8.2.110.0000.01122.12
8.2.100.0000.01117.93
8.2.90.0060.00319.05
8.2.80.0030.00617.97
8.2.70.0030.00617.50
8.2.60.0070.00317.80
8.2.50.0040.00418.07
8.2.40.0030.00619.20
8.2.30.0030.00620.69
8.2.20.0040.00417.59
8.2.10.0000.00718.07
8.2.00.0000.00818.09
8.1.280.0170.00325.92
8.1.270.0070.00023.97
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0120.00622.57
8.1.230.0120.00017.79
8.1.220.0000.00817.74
8.1.210.0030.00518.77
8.1.200.0000.01017.36
8.1.190.0040.00417.25
8.1.180.0040.00418.10
8.1.170.0040.00818.59
8.1.160.0040.00421.96
8.1.150.0090.00018.79
8.1.140.0080.00021.36
8.1.130.0000.00717.70
8.1.120.0040.00417.50
8.1.110.0000.00817.46
8.1.100.0050.00217.44
8.1.90.0050.00317.47
8.1.80.0040.00417.35
8.1.70.0070.00017.34
8.1.60.0040.00417.56
8.1.50.0050.00317.51
8.1.40.0080.00017.51
8.1.30.0030.00517.65
8.1.20.0060.00317.67
8.1.10.0040.00417.52
8.1.00.0040.00417.33
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0000.00718.48
8.0.270.0030.00317.16
8.0.260.0060.00017.25
8.0.250.0070.00016.84
8.0.240.0000.00716.85
8.0.230.0070.00016.96
8.0.220.0040.00416.85
8.0.210.0000.00816.91
8.0.200.0030.00316.84
8.0.190.0080.00016.90
8.0.180.0080.00016.88
8.0.170.0000.00716.77
8.0.160.0030.00316.95
8.0.150.0050.00316.80
8.0.140.0000.00716.89
8.0.130.0030.00513.33
8.0.120.0040.00416.86
8.0.110.0070.00016.81
8.0.100.0030.00316.85
8.0.90.0030.00516.79
8.0.80.0140.00316.81
8.0.70.0080.00016.73
8.0.60.0000.00716.68
8.0.50.0000.00716.83
8.0.30.0140.00517.29
8.0.20.0130.00617.40
8.0.10.0000.00716.89
8.0.00.0070.01116.64
7.4.330.0050.00015.08
7.4.320.0000.00716.50
7.4.300.0060.00016.52
7.4.290.0000.00716.41
7.4.280.0000.00916.51
7.4.270.0000.00716.49
7.4.260.0030.00316.58
7.4.250.0040.00416.48
7.4.240.0040.00416.52
7.4.230.0050.00216.53
7.4.220.0070.01016.63
7.4.210.0100.00716.64
7.4.200.0070.00016.70
7.4.160.0120.00316.50
7.4.150.0090.00917.40
7.4.140.0100.01017.86
7.4.130.0090.01016.73
7.4.120.0090.00916.54
7.4.110.0180.00016.64
7.4.100.0130.01016.42
7.4.90.0080.00816.40
7.4.80.0090.01519.39
7.4.70.0120.00416.43
7.4.60.0060.01116.57
7.4.50.0040.00016.45
7.4.40.0130.00316.43
7.4.30.0120.01216.52
7.4.00.0030.00615.17
7.3.330.0000.00613.33
7.3.320.0000.00613.36
7.3.310.0030.00316.26
7.3.300.0000.00716.41
7.3.290.0040.01216.37
7.3.280.0090.00716.35
7.3.270.0150.00917.40
7.3.260.0060.01116.60
7.3.250.0110.00816.35
7.3.240.0070.01016.54
7.3.230.0150.00316.61
7.3.210.0080.00816.45
7.3.200.0100.00616.48
7.3.190.0080.00816.29
7.3.180.0070.01016.58
7.3.170.0000.01616.39
7.3.160.0120.00316.41
7.2.330.0090.00916.68
7.2.320.0060.01016.60
7.2.310.0130.00716.73
7.2.300.0070.01016.74
7.2.290.0030.01316.72
7.2.60.0070.01016.94
7.2.00.0030.00919.27
7.1.200.0040.00815.63
7.1.100.0060.01018.15
7.1.70.0060.00917.11
7.1.60.0030.02119.50
7.1.50.0060.00916.76
7.1.00.0030.07722.57
7.0.200.0050.00216.67
7.0.60.0130.08019.95
7.0.50.0030.06017.93
7.0.40.0100.08320.13
7.0.30.0230.03720.30
7.0.20.0270.07720.30
7.0.10.0270.08020.07
7.0.00.0170.07320.33
5.6.280.0030.07321.12
5.6.210.0030.04020.61
5.6.200.0030.05318.20
5.6.190.0070.06720.68
5.6.180.4000.03320.36
5.6.170.0100.04720.71
5.6.160.0170.07020.47
5.6.150.0100.03718.27
5.6.140.0000.04018.18
5.6.130.0030.07318.14
5.6.120.0070.08321.12
5.6.110.0070.03720.98
5.6.100.0100.08021.03
5.6.90.0070.07021.02
5.6.80.0030.04320.52
5.6.70.4170.04320.39
5.5.350.0130.03320.44
5.5.340.0130.08017.97
5.5.330.0030.05020.41
5.5.320.0530.06320.30
5.5.310.0130.05020.42
5.5.300.0070.04718.02
5.5.290.0070.08017.92
5.5.280.0070.04020.74
5.5.270.0000.09320.73
5.5.260.0070.07020.89
5.5.250.0100.07720.79
5.5.240.0030.08320.11
5.4.450.0430.06019.61
5.4.440.0130.06719.18
5.4.430.0200.05719.38
5.4.420.0330.04319.70
5.4.410.0230.05319.09
5.4.400.0230.05319.26
5.4.390.0230.05319.16
5.4.380.0300.06319.05
5.4.370.0230.06019.06
5.4.360.0230.07719.38
5.4.350.0300.07318.84
5.4.340.0270.07719.23
5.4.320.0230.06319.15
5.4.310.0200.07019.00
5.4.300.0270.06019.12
5.4.290.0270.04719.14
5.4.280.0370.04719.30
5.4.270.0430.04019.25
5.4.260.0230.05019.28
5.4.250.0230.06018.88
5.4.240.0330.05019.25
5.4.230.0300.05019.27
5.4.220.0300.05019.11
5.4.210.0170.06019.30
5.4.200.0370.05319.25
5.4.190.0170.06319.27
5.4.180.0230.05019.37
5.4.170.0300.04018.86
5.4.160.0200.05718.96
5.4.150.0230.06018.99
5.4.140.0230.06316.51
5.4.130.0170.06316.34
5.4.120.0100.06016.51
5.4.110.0230.06316.45
5.4.100.0170.05716.60
5.4.90.0330.05716.63
5.4.80.0270.04316.18
5.4.70.0270.04716.56
5.4.60.0230.05016.60
5.4.50.0230.06316.49
5.4.40.0230.04716.49
5.4.30.0130.05716.45
5.4.20.0300.04716.58
5.4.10.0130.05716.59
5.4.00.0230.05015.99

preferences:
56.46 ms | 401 KiB | 5 Q