3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen1($a = 0) { $i = 0; while($i < 5) { yield $a; $a = $a + 1; $i = $i + 1; } return $a * 5; } function yf() { $bs = yield from []; echo "Done with the garbage iterator. Should return nothing. Actual return value below:\n"; var_dump($bs); $som = yield from [1, 2, 3]; echo "Done with the iterator. Result was $som\n"; $res = yield from gen1(); echo "Done with the first generator. Result was $res\n"; $oth = yield from gen1($res); echo "Done with the second generator. Result was $oth\n"; return $oth; } $g = yf(); foreach($g as $val) { var_dump($val); } var_dump($g->getReturn());

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.0080.00816.25
8.3.50.0080.01221.98
8.3.40.0060.00918.53
8.3.30.0070.00718.44
8.3.20.0040.00420.21
8.3.10.0000.00823.48
8.3.00.0080.00019.38
8.2.180.0150.00018.41
8.2.170.0090.00922.96
8.2.160.0110.00722.21
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00417.75
8.2.120.0000.00826.35
8.2.110.0070.00322.11
8.2.100.0000.01118.04
8.2.90.0080.00019.23
8.2.80.0040.00417.97
8.2.70.0040.00417.50
8.2.60.0060.00317.80
8.2.50.0040.00418.07
8.2.40.0040.00419.46
8.2.30.0040.00420.61
8.2.20.0040.00717.68
8.2.10.0050.00318.01
8.2.00.0080.00018.07
8.1.280.0090.00625.92
8.1.270.0080.00022.02
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0000.00920.83
8.1.230.0090.00617.76
8.1.220.0040.00417.76
8.1.210.0080.00018.77
8.1.200.0090.00017.38
8.1.190.0000.00817.35
8.1.180.0000.00818.10
8.1.170.0030.00618.71
8.1.160.0070.00022.02
8.1.150.0040.00418.83
8.1.140.0050.00319.45
8.1.130.0070.00017.69
8.1.120.0000.00717.50
8.1.110.0000.00817.47
8.1.100.0000.00717.36
8.1.90.0040.00417.49
8.1.80.0000.00717.38
8.1.70.0000.00717.35
8.1.60.0000.00917.61
8.1.50.0050.00317.42
8.1.40.0080.00017.45
8.1.30.0040.00417.68
8.1.20.0000.00817.61
8.1.10.0000.00717.42
8.1.00.0040.00417.34
8.0.300.0070.00018.77
8.0.290.0070.00016.75
8.0.280.0000.00718.46
8.0.270.0000.00717.20
8.0.260.0030.00317.20
8.0.250.0040.00417.00
8.0.240.0050.00316.80
8.0.230.0040.00416.98
8.0.220.0000.00716.88
8.0.210.0040.00416.82
8.0.200.0060.00016.85
8.0.190.0070.00016.96
8.0.180.0050.00216.80
8.0.170.0090.00016.89
8.0.160.0030.00716.90
8.0.150.0030.00516.84
8.0.140.0030.00516.86
8.0.130.0030.00313.36
8.0.120.0000.00816.81
8.0.110.0040.00416.96
8.0.100.0000.00716.94
8.0.90.0000.00816.82
8.0.80.0030.01416.91
8.0.70.0000.00816.77
8.0.60.0070.00016.77
8.0.50.0040.00416.74
8.0.30.0090.01117.15
8.0.20.0120.01017.40
8.0.10.0000.00716.84
8.0.00.0130.00416.77
7.4.330.0040.00415.08
7.4.320.0060.00016.52
7.4.300.0060.00016.52
7.4.290.0000.00716.40
7.4.280.0060.00316.51
7.4.270.0080.00016.50
7.4.260.0050.00216.49
7.4.250.0080.00016.52
7.4.240.0020.00516.58
7.4.230.0040.00416.68
7.4.220.0090.00916.61
7.4.210.0100.01016.52
7.4.200.0040.00416.57
7.4.160.0050.01016.66
7.4.150.0110.00817.40
7.4.140.0090.01217.86
7.4.130.0090.01116.37
7.4.120.0090.00916.60
7.4.110.0080.01116.55
7.4.100.0070.01116.46
7.4.90.0100.01316.58
7.4.80.0050.01119.39
7.4.70.0070.01016.61
7.4.60.0070.01016.47
7.4.50.0100.00716.14
7.4.40.0040.01516.40
7.4.30.0030.01416.70
7.4.00.0110.00514.90
7.3.330.0020.00213.16
7.3.320.0000.00513.24
7.3.310.0060.00016.41
7.3.300.0050.00216.37
7.3.290.0070.00716.35
7.3.280.0100.00716.36
7.3.270.0090.00917.40
7.3.260.0140.00716.56
7.3.250.0090.00816.40
7.3.240.0130.00616.41
7.3.230.0140.00316.39
7.3.210.0080.00816.23
7.3.200.0080.01516.52
7.3.190.0080.00816.65
7.3.180.0100.00616.47
7.3.170.0060.00916.54
7.3.160.0070.01416.41
7.3.120.0000.01914.74
7.3.110.0070.01114.82
7.3.100.0100.00714.79
7.3.90.0040.00714.94
7.3.80.0030.01014.80
7.3.70.0000.01714.77
7.3.60.0070.00714.72
7.3.50.0100.00314.78
7.3.40.0100.00614.84
7.3.30.0070.00714.83
7.3.20.0040.01416.66
7.3.10.0030.01316.74
7.3.00.0090.00616.79
7.2.330.0150.00316.51
7.2.320.0100.00716.48
7.2.310.0080.00816.55
7.2.300.0030.01316.55
7.2.290.0110.00716.82
7.2.250.0040.01515.27
7.2.240.0100.01014.96
7.2.230.0120.00315.29
7.2.220.0060.00915.20
7.2.210.0040.01214.92
7.2.200.0060.00914.70
7.2.190.0100.00715.05
7.2.180.0060.00614.73
7.2.170.0030.01015.11
7.2.60.0110.00416.64
7.2.00.0040.00819.24
7.1.330.0040.01115.94
7.1.320.0030.01015.90
7.1.310.0040.01415.96
7.1.300.0100.00315.77
7.1.290.0060.00915.87
7.1.280.0040.00715.56
7.1.270.0040.00715.57
7.1.260.0030.01215.68
7.1.200.0000.01415.69
7.1.100.0030.01018.06
7.1.70.0080.00017.26
7.1.60.0110.01419.48
7.1.50.0110.01416.78
7.1.00.0070.07022.35
7.0.200.0270.00914.66
7.0.60.0200.07319.85
7.0.50.0070.04717.93
7.0.40.0030.08020.02
7.0.30.0030.05020.29
7.0.20.0200.04720.20
7.0.10.0130.08020.25
7.0.00.0070.06720.12
5.6.280.0000.03321.02
5.6.210.0070.05720.57
5.6.200.0100.07018.24
5.6.190.0130.05720.34
5.6.180.0330.07020.35
5.6.170.0300.07720.51
5.6.160.0170.04720.55
5.6.150.0000.09018.15
5.6.140.0170.07318.23
5.6.130.0130.04318.14
5.6.120.0100.08321.04
5.6.110.0200.05320.89
5.6.100.0130.07720.89
5.6.90.0200.07021.00
5.6.80.0030.04020.54
5.5.350.0170.05720.43
5.5.340.0000.08017.95
5.5.330.0030.05020.21
5.5.320.0270.05020.26
5.5.310.0300.07320.37
5.5.300.0000.04017.95
5.5.290.0070.04317.95
5.5.280.0070.08020.74
5.5.270.0170.07020.87
5.5.260.0130.07020.98
5.5.250.0070.08320.61
5.5.240.0170.03020.27

preferences:
60.44 ms | 401 KiB | 5 Q