3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('error_reporting', -1); ini_set('display_errors', 'on'); $a = []; function generator() { global $a; foreach($a as $i){ yield $i; } $a = []; } function test() { yield from generator(); } $generator = test(); if ($generator->valid()) { foreach($generator as $i) { echo $i; } } else { echo 'Nothing'; }

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.0090.00916.75
8.3.50.0080.00816.63
8.3.40.0110.00418.80
8.3.30.0040.01118.58
8.3.20.0080.00019.07
8.3.10.0030.00521.77
8.3.00.0050.00319.34
8.2.180.0120.00616.61
8.2.170.0180.00422.96
8.2.160.0100.00320.34
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0070.00020.52
8.2.120.0080.00026.35
8.2.110.0060.00321.12
8.2.100.0090.00317.72
8.2.90.0050.00319.23
8.2.80.0060.00317.97
8.2.70.0000.00817.38
8.2.60.0050.00317.78
8.2.50.0000.00718.10
8.2.40.0040.00422.37
8.2.30.0060.00320.91
8.2.20.0050.00517.95
8.2.10.0040.00418.13
8.2.00.0040.00418.13
8.1.280.0040.01125.92
8.1.270.0000.00723.92
8.1.260.0040.00426.35
8.1.250.0020.00528.09
8.1.240.0060.00323.97
8.1.230.0040.00717.76
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0000.00817.23
8.1.190.0040.00417.48
8.1.180.0080.00018.10
8.1.170.0080.00018.48
8.1.160.0000.00718.94
8.1.150.0060.00320.74
8.1.140.0030.00621.27
8.1.130.0000.00718.89
8.1.120.0000.00717.49
8.1.110.0100.00017.39
8.1.100.0030.00517.48
8.1.90.0100.00017.45
8.1.80.0050.00317.43
8.1.70.0000.00717.48
8.1.60.0030.00517.53
8.1.50.0000.00717.41
8.1.40.0050.00317.58
8.1.30.0060.00317.55
8.1.20.0000.00717.62
8.1.10.0040.00417.50
8.1.00.0060.00317.46
8.0.300.0000.00718.77
8.0.290.0030.00616.58
8.0.280.0040.00418.32
8.0.270.0080.00017.21
8.0.260.0050.00316.77
8.0.250.0040.00416.96
8.0.240.0050.00316.95
8.0.230.0000.00717.00
8.0.220.0000.00716.91
8.0.210.0000.00716.92
8.0.200.0000.00616.85
8.0.190.0000.00817.01
8.0.180.0000.00816.84
8.0.170.0000.00716.93
8.0.160.0040.00416.86
8.0.150.0030.00516.74
8.0.140.0080.00016.86
8.0.130.0050.00013.32
8.0.120.0040.00416.76
8.0.110.0000.00716.73
8.0.100.0000.00716.96
8.0.90.0080.00016.84
8.0.80.0060.01216.88
8.0.70.0000.00716.88
8.0.60.0040.00417.02
8.0.50.0040.00416.77
8.0.30.0140.00316.93
8.0.20.0140.01117.40
8.0.10.0000.00716.82
8.0.00.0160.00317.02
7.4.330.0000.00515.55
7.4.320.0070.00016.53
7.4.300.0030.00316.62
7.4.290.0070.00016.53
7.4.280.0050.00316.51
7.4.270.0060.00016.65
7.4.260.0050.00213.34
7.4.250.0000.00716.58
7.4.240.0050.00316.37
7.4.230.0070.00016.71
7.4.220.0060.01316.44
7.4.210.0070.00716.54
7.4.200.0030.00316.54
7.4.160.0170.00416.52
7.4.150.0060.01317.40
7.4.140.0130.00917.86
7.4.130.0150.00316.66
7.4.120.0090.01116.54
7.4.110.0100.00716.57
7.4.100.0090.01216.49
7.4.90.0090.00916.55
7.4.80.0110.01119.39
7.4.70.0000.01616.39
7.4.60.0030.01216.49
7.4.50.0100.00716.61
7.4.40.0120.00416.41
7.4.30.0100.00716.46
7.4.00.0140.00314.91
7.3.330.0000.00813.14
7.3.320.0050.00013.31
7.3.310.0030.00616.28
7.3.300.0030.00316.18
7.3.290.0040.01216.29
7.3.280.0080.00716.27
7.3.270.0130.00317.40
7.3.260.0100.00616.44
7.3.250.0100.00916.46
7.3.240.0110.00616.29
7.3.230.0110.00716.43
7.3.210.0070.01016.42
7.3.200.0090.00616.43
7.3.190.0100.00616.45
7.3.180.0080.00816.56
7.3.170.0040.01116.58
7.3.160.0130.00316.55
7.2.330.0060.01316.80
7.2.320.0130.01016.52
7.2.310.0030.01316.53
7.2.300.0110.01116.71
7.2.290.0090.01516.69
7.2.60.0030.01017.00
7.2.00.0070.01019.62
7.1.200.0210.00315.32
7.1.100.0040.01118.02
7.1.70.0020.00517.23
7.1.60.1300.01033.21
7.1.50.1370.01032.98
7.1.40.1570.00332.48
7.1.30.1930.00732.79
7.1.20.1670.00732.57
7.1.10.1300.00314.61
7.1.00.1800.00714.51
7.0.200.1600.00714.79
7.0.190.1700.01314.79
7.0.180.1400.01014.18
7.0.170.2300.00314.32
7.0.160.2670.01314.51
7.0.150.1130.01014.42
7.0.140.1570.01014.38
7.0.130.1400.00714.69
7.0.120.1370.01314.69
7.0.110.1370.01314.46
7.0.100.1500.00714.47
7.0.90.1330.01014.52
7.0.80.1470.00314.44
7.0.70.1470.01014.24
7.0.60.1530.01014.44
7.0.50.1270.00714.23
7.0.40.1270.00714.64
7.0.30.1270.00714.55
7.0.20.1700.01014.59
7.0.10.1130.01314.49
7.0.00.1200.01014.46

preferences:
44.5 ms | 401 KiB | 5 Q