3v4l.org

run code in 300+ PHP versions simultaneously
<?php function yieldMe() : iterable { yield 1; yield 2; yield 3; } function someFunction(bool $toArray=true) : iterable { $found = yieldMe(); if($toArray){ return iterator_to_array($found); } yield from $found; } $result = someFunction(); foreach($result as $r){ echo $r."\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.60.0040.01118.43
8.3.50.0100.01016.34
8.3.40.0040.01118.37
8.3.30.0110.00718.71
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.180.0110.00425.92
8.2.170.0060.01318.96
8.2.160.0030.01022.96
8.2.150.0050.00325.66
8.2.140.0080.00024.66
8.2.130.0060.00326.16
8.2.120.0070.00026.35
8.2.110.0070.00321.18
8.2.100.0080.00417.78
8.2.90.0000.00817.63
8.2.80.0030.00518.79
8.2.70.0080.00017.50
8.2.60.0030.00618.03
8.2.50.0030.00518.05
8.2.40.0080.00019.57
8.2.30.0000.00717.92
8.2.20.0040.00417.97
8.2.10.0060.00319.17
8.2.00.0000.00719.12
8.1.280.0090.00925.92
8.1.270.0070.00023.99
8.1.260.0000.00728.09
8.1.250.0000.00828.09
8.1.240.0030.00619.58
8.1.230.0040.00719.25
8.1.220.0060.00317.76
8.1.210.0040.00418.77
8.1.200.0050.00517.48
8.1.190.0000.00817.48
8.1.180.0000.00818.10
8.1.170.0040.00418.39
8.1.160.0070.00018.88
8.1.150.0040.00418.83
8.1.140.0040.00418.93
8.1.130.0070.00019.14
8.1.120.0000.00717.48
8.1.110.0000.00717.45
8.1.100.0000.00717.50
8.1.90.0070.00017.45
8.1.80.0030.00617.47
8.1.70.0030.00617.48
8.1.60.0050.00317.48
8.1.50.0050.00317.52
8.1.40.0060.00317.57
8.1.30.0030.00617.65
8.1.20.0080.00017.67
8.1.10.0030.00617.55
8.1.00.0040.00417.39
8.0.300.0020.00518.77
8.0.290.0080.00016.75
8.0.280.0030.00318.46
8.0.270.0040.00418.01
8.0.260.0060.00016.83
8.0.250.0020.00516.95
8.0.240.0030.00316.85
8.0.230.0000.00716.92
8.0.220.0000.00716.81
8.0.210.0030.00316.88
8.0.200.0060.00017.02
8.0.190.0040.00416.84
8.0.180.0040.00416.77
8.0.170.0000.00916.81
8.0.160.0030.00416.86
8.0.150.0000.00716.86
8.0.140.0000.00716.81
8.0.130.0000.00613.37
8.0.120.0000.00716.89
8.0.110.0030.00516.87
8.0.100.0040.00416.75
8.0.90.0070.00016.96
8.0.80.0060.00916.88
8.0.70.0000.00816.77
8.0.60.0000.00716.70
8.0.50.0040.00416.88
8.0.30.0080.00916.86
8.0.20.0110.00916.90
8.0.10.0090.01016.96
8.0.00.0140.00717.03
7.4.330.0000.00515.55
7.4.320.0070.00016.51
7.4.300.0000.00816.52
7.4.290.0000.00816.53
7.4.280.0040.00416.49
7.4.270.0070.00016.61
7.4.260.0030.00313.30
7.4.250.0000.00816.56
7.4.240.0050.00216.46
7.4.230.0000.00716.61
7.4.220.0020.00616.59
7.4.210.0100.00616.55
7.4.200.0070.00016.39
7.4.160.0100.01216.61
7.4.150.0110.01116.66
7.4.140.0110.01016.51
7.4.130.0080.01316.49
7.4.120.0130.00816.44
7.4.110.0090.00916.56
7.4.100.0120.00716.45
7.4.90.0100.00916.46
7.4.80.0080.01316.43
7.4.70.0110.00816.54
7.4.60.0080.01016.42
7.4.50.0080.01016.34
7.4.40.0110.00816.43
7.4.30.0120.01016.49
7.4.20.0110.01316.52
7.4.10.0160.00316.37
7.4.00.0130.00916.53
7.3.330.0070.00016.40
7.3.320.0040.00413.13
7.3.310.0040.00416.40
7.3.300.0030.00616.30
7.3.290.0100.00716.25
7.3.270.0030.01516.29
7.3.260.0120.00816.27
7.3.250.0080.01116.33
7.3.240.0080.01016.33
7.3.230.0120.00916.24
7.3.220.0080.00916.21
7.3.210.0100.00816.22
7.3.200.0070.01016.23
7.3.190.0060.01216.23
7.3.180.0060.01016.19
7.3.170.0050.01416.20
7.3.160.0080.01016.21
7.3.150.0120.00716.25
7.3.140.0120.01016.22
7.3.130.0130.01016.23
7.3.120.0120.00816.22
7.3.110.0120.00916.17
7.3.100.0100.00916.21
7.3.90.0160.00516.47
7.3.80.0080.00916.22
7.3.70.0050.01116.31
7.3.60.0090.01116.40
7.3.50.0080.00816.37
7.3.40.0090.01016.37
7.3.30.0020.01816.38
7.3.20.0060.01316.45
7.3.10.0020.01516.33
7.3.00.0230.00816.31

preferences:
65.25 ms | 400 KiB | 5 Q