3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen(): Generator { yield new stdClass() => 'foo'; yield ['a'] => 'foo'; yield gen2() => 'foo'; } function gen2(): Generator { yield 'bar'; } gen(); foreach(gen() as $key => $value) { var_dump($key, $value); }

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.0130.00916.63
8.3.50.0130.00717.98
8.3.40.0070.00718.84
8.3.30.0130.00618.77
8.3.20.0020.00524.18
8.3.10.0040.00424.66
8.3.00.0050.00326.16
8.2.180.0040.01825.92
8.2.170.0000.01518.79
8.2.160.0100.00322.96
8.2.150.0000.00725.66
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0050.00326.35
8.2.110.0070.00321.07
8.2.100.0030.00917.84
8.2.90.0000.00817.91
8.2.80.0090.00018.22
8.2.70.0000.00817.50
8.2.60.0050.00317.63
8.2.50.0040.00418.05
8.2.40.0040.00418.15
8.2.30.0070.00017.99
8.2.20.0040.00417.95
8.2.10.0040.00419.25
8.2.00.0050.00319.11
8.1.280.0090.01225.92
8.1.270.0040.00423.99
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0030.00623.89
8.1.230.0030.00720.96
8.1.220.0050.00317.78
8.1.210.0040.00418.78
8.1.200.0080.00017.35
8.1.190.0000.00817.22
8.1.180.0030.00618.10
8.1.170.0000.00918.39
8.1.160.0030.00518.90
8.1.150.0050.00218.89
8.1.140.0040.00418.79
8.1.130.0000.00720.14
8.1.120.0040.00417.36
8.1.110.0060.00317.46
8.1.100.0070.00017.46
8.1.90.0000.00717.33
8.1.80.0100.00017.42
8.1.70.0000.00817.36
8.1.60.0040.00417.57
8.1.50.0040.00417.40
8.1.40.0030.00617.54
8.1.30.0040.00417.69
8.1.20.0050.00517.57
8.1.10.0000.00717.64
8.1.00.0000.00817.57
8.0.300.0070.00019.98
8.0.290.0070.00016.75
8.0.280.0030.00318.44
8.0.270.0060.00317.91
8.0.260.0040.00418.50
8.0.250.0070.00016.85
8.0.240.0000.00716.97
8.0.230.0030.00316.84
8.0.220.0000.00816.89
8.0.210.0040.00416.95
8.0.200.0000.00716.97
8.0.190.0040.00416.84
8.0.180.0070.00016.92
8.0.170.0040.00416.94
8.0.160.0000.00816.91
8.0.150.0000.00716.90
8.0.140.0060.00316.91
8.0.130.0000.00513.40
8.0.120.0060.00316.84
8.0.110.0040.00416.78
8.0.100.0000.00816.72
8.0.90.0000.00716.95
8.0.80.0100.00516.90
8.0.70.0070.00016.70
8.0.60.0000.00716.95
8.0.50.0040.00416.76
8.0.30.0090.00616.88
8.0.20.0090.01216.93
8.0.10.0090.01216.93
8.0.00.0090.01416.97
7.4.330.0050.00015.55
7.4.320.0040.00416.50
7.4.300.0000.00616.59
7.4.290.0040.00416.42
7.4.280.0070.00016.42
7.4.270.0050.00316.59
7.4.260.0030.00313.28
7.4.250.0070.00016.33
7.4.240.0010.00616.42
7.4.230.0050.00216.66
7.4.220.0030.00316.59
7.4.210.0110.00716.64
7.4.200.0030.00316.49
7.4.160.0150.00416.55
7.4.150.0040.01116.63
7.4.140.0070.01316.48
7.4.130.0090.01216.43
7.4.120.0080.01416.42
7.4.110.0120.00916.48
7.4.100.0060.01516.60
7.4.90.0030.01616.55
7.4.80.0110.00816.48
7.4.70.0130.01016.43
7.4.60.0080.01116.48
7.4.50.0100.01016.33
7.4.40.0110.00816.42
7.4.30.0040.01516.35
7.4.20.0150.00616.49
7.4.10.0060.01516.41
7.4.00.0110.00516.45
7.3.330.0030.00316.22
7.3.320.0000.00813.09
7.3.310.0070.00016.19
7.3.300.0030.00316.11
7.3.290.0110.00616.22
7.3.270.0150.00016.22
7.3.260.0120.00316.15
7.3.250.0070.01416.23
7.3.240.0100.01016.22
7.3.230.0070.00716.16
7.3.220.0050.01416.31
7.3.210.0030.01516.14
7.3.200.0060.01416.21
7.3.190.0040.01516.23
7.3.180.0140.00416.27
7.3.170.0070.00716.14
7.3.160.0030.01616.18
7.3.150.0130.00616.21
7.3.140.0070.01416.18
7.3.130.0090.00616.30
7.3.120.0000.01916.16
7.3.110.0070.01116.10
7.3.100.0080.00716.09
7.3.90.0000.01716.40
7.3.80.0070.00716.19
7.3.70.0100.00616.32
7.3.60.0030.01416.37
7.3.50.0140.00416.36
7.3.40.0040.01116.29
7.3.30.0140.00316.30
7.3.20.0110.00316.45
7.3.10.0080.00816.38
7.3.00.0090.00916.48

preferences:
82.62 ms | 401 KiB | 5 Q