3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function test() { return $this->getGenerator(range(0, 10)); } public function getGenerator(array $items) { foreach ($items as $item) { yield $item; } } } $f = new Foo; foreach ($f->test() as $item) { var_dump($item); }

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.0070.00716.75
8.3.50.0130.00821.20
8.3.40.0120.00318.68
8.3.30.0040.01118.60
8.3.20.0040.00420.00
8.3.10.0050.00321.89
8.3.00.0030.00523.53
8.2.180.0000.01416.50
8.2.170.0120.00622.96
8.2.160.0070.00720.38
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0080.00020.65
8.2.120.0040.00426.35
8.2.110.0070.00319.45
8.2.100.0080.00318.05
8.2.90.0040.00419.25
8.2.80.0040.00417.97
8.2.70.0080.00017.38
8.2.60.0040.00417.93
8.2.50.0040.00418.09
8.2.40.0050.00320.34
8.2.30.0030.00319.44
8.2.20.0070.00017.69
8.2.10.0000.00717.94
8.2.00.0000.00817.94
8.1.280.0100.00725.92
8.1.270.0050.00222.07
8.1.260.0080.00028.09
8.1.250.0050.00328.09
8.1.240.0030.00622.59
8.1.230.0040.00817.70
8.1.220.0030.00517.74
8.1.210.0040.00418.77
8.1.200.0000.00917.38
8.1.190.0080.00017.35
8.1.180.0030.00618.10
8.1.170.0040.00418.64
8.1.160.0040.00420.81
8.1.150.0000.00719.02
8.1.140.0000.00819.58
8.1.130.0040.00417.75
8.1.120.0000.00717.50
8.1.110.0020.00517.45
8.1.100.0080.00017.45
8.1.90.0000.00717.42
8.1.80.0000.01017.46
8.1.70.0030.00517.45
8.1.60.0000.00717.55
8.1.50.0000.00917.51
8.1.40.0050.00317.50
8.1.30.0030.00517.64
8.1.20.0040.00417.66
8.1.10.0080.00017.57
8.1.00.0000.00817.48
8.0.300.0000.00818.77
8.0.290.0000.00716.88
8.0.280.0070.00018.51
8.0.270.0040.00417.31
8.0.260.0000.00618.45
8.0.250.0070.00017.02
8.0.240.0000.00716.86
8.0.230.0030.00317.00
8.0.220.0100.00016.88
8.0.210.0030.00316.92
8.0.200.0030.00316.84
8.0.190.0030.00516.88
8.0.180.0040.00416.87
8.0.170.0030.00616.95
8.0.160.0040.00416.95
8.0.150.0060.00316.87
8.0.140.0080.00016.76
8.0.130.0000.00613.29
8.0.120.0050.00316.84
8.0.110.0080.00016.76
8.0.100.0040.00416.77
8.0.90.0050.00216.79
8.0.80.0110.00416.87
8.0.70.0050.00216.96
8.0.60.0080.00016.84
8.0.50.0040.00416.89
8.0.30.0150.00517.27
8.0.20.0160.00717.40
8.0.10.0030.00517.04
8.0.00.0070.01116.90
7.4.330.0000.00516.77
7.4.320.0030.00316.52
7.4.300.0060.00216.56
7.4.290.0000.00716.59
7.4.280.0030.00616.50
7.4.270.0040.00416.54
7.4.260.0030.00316.48
7.4.250.0050.00216.58
7.4.240.0070.00016.54
7.4.230.0000.00716.63
7.4.220.0130.01316.54
7.4.210.0070.00916.53
7.4.200.0070.00016.63
7.4.160.0110.00416.48
7.4.150.0170.00817.40
7.4.140.0100.01117.86
7.4.130.0080.01116.42
7.4.120.0080.01016.54
7.4.110.0120.00916.41
7.4.100.0000.01716.68
7.4.90.0140.00416.49
7.4.80.0070.01019.39
7.4.70.0110.00516.67
7.4.60.0100.01016.57
7.4.50.0040.01116.44
7.4.40.0100.00716.56
7.4.30.0130.00616.49
7.4.00.0120.00415.02
7.3.330.0030.00313.39
7.3.320.0020.00213.18
7.3.310.0000.00716.22
7.3.300.0030.00316.23
7.3.290.0000.00716.23
7.3.280.0090.01016.30
7.3.270.0070.01117.40
7.3.260.0040.01416.52
7.3.250.0110.00716.55
7.3.240.0130.00416.45
7.3.230.0070.01016.59
7.3.210.0170.00016.40
7.3.200.0120.00919.39
7.3.190.0170.00316.61
7.3.180.0070.01116.55
7.3.170.0060.01716.37
7.3.160.0060.01416.30
7.2.330.0130.00316.54
7.2.320.0060.01216.56
7.2.310.0080.01116.73
7.2.300.0060.01216.85
7.2.290.0070.01016.68
7.1.70.0000.00817.23
7.1.60.0070.01519.40
7.1.50.0060.00817.04
7.1.00.0030.07322.32
7.0.200.0240.00914.65
7.0.60.0130.07721.77
7.0.50.0030.04017.88
7.0.40.0130.04720.21
7.0.30.0330.07320.17
7.0.20.0400.06720.07
7.0.10.0070.08020.33
7.0.00.0130.07720.25
5.6.280.0070.03021.05
5.6.210.0030.04320.51
5.6.200.0170.06718.19
5.6.190.0030.07720.48
5.6.180.0330.07720.46
5.6.170.0330.07720.39
5.6.160.0030.04020.55
5.6.150.0230.04318.16
5.6.140.0000.04018.18
5.6.130.0030.04018.15
5.6.120.0070.08321.00
5.6.110.0070.07721.02
5.6.100.0100.04021.09
5.6.90.0000.08721.08
5.6.80.0070.08720.54
5.5.350.0300.07720.41
5.5.340.0100.08317.95
5.5.330.0100.08320.37
5.5.320.0400.05020.32
5.5.310.0370.03320.37
5.5.300.0000.04318.02
5.5.290.0100.08018.04
5.5.280.0100.07020.69
5.5.270.0000.07320.98
5.5.260.0100.03720.67
5.5.250.0070.08320.69
5.5.240.4230.04720.27

preferences:
37.46 ms | 401 KiB | 5 Q