3v4l.org

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

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.40.0070.00718.73
8.3.30.0080.00818.63
8.3.20.0070.00020.34
8.3.10.0040.00421.77
8.3.00.0000.00821.88
8.2.170.0040.01118.95
8.2.160.0130.00322.96
8.2.150.0030.00525.66
8.2.140.0080.00024.66
8.2.130.0000.00820.69
8.2.120.0030.00526.35
8.2.110.0040.00419.45
8.2.100.0110.00018.05
8.2.90.0080.00019.20
8.2.80.0040.00417.97
8.2.70.0030.00717.63
8.2.60.0000.00817.80
8.2.50.0040.00418.09
8.2.40.0080.00020.50
8.2.30.0070.00019.52
8.2.20.0040.00417.75
8.2.10.0000.00717.95
8.2.00.0000.00718.00
8.1.270.0080.00024.66
8.1.260.0050.00328.09
8.1.250.0040.00428.09
8.1.240.0060.00322.48
8.1.230.0070.00317.77
8.1.220.0040.00417.76
8.1.210.0000.00818.77
8.1.200.0030.00717.38
8.1.190.0040.00417.35
8.1.180.0000.00818.10
8.1.170.0030.00518.62
8.1.160.0000.00720.81
8.1.150.0000.00718.93
8.1.140.0030.00619.68
8.1.130.0060.00317.66
8.1.120.0030.00417.38
8.1.110.0040.00417.50
8.1.100.0080.00017.43
8.1.90.0040.00417.52
8.1.80.0040.00417.40
8.1.70.0030.00317.48
8.1.60.0030.00617.59
8.1.50.0030.00617.43
8.1.40.0000.00817.53
8.1.30.0030.00517.57
8.1.20.0080.00017.67
8.1.10.0000.00817.47
8.1.00.0040.00417.57
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0030.00318.49
8.0.270.0000.00717.31
8.0.260.0040.00417.16
8.0.250.0070.00017.03
8.0.240.0040.00416.95
8.0.230.0000.00716.83
8.0.220.0070.00416.91
8.0.210.0000.00716.77
8.0.200.0030.00316.86
8.0.190.0030.00616.94
8.0.180.0000.00816.94
8.0.170.0030.00516.89
8.0.160.0000.00816.87
8.0.150.0050.00316.89
8.0.140.0070.00016.88
8.0.130.0050.00013.32
8.0.120.0040.00416.88
8.0.110.0030.00516.88
8.0.100.0020.00516.79
8.0.90.0040.00417.02
8.0.80.0120.00916.94
8.0.70.0040.00417.00
8.0.60.0070.00016.80
8.0.50.0000.00816.91
8.0.30.0080.01017.12
8.0.20.0130.01117.40
8.0.10.0040.00416.91
8.0.00.0130.00516.71
7.4.330.0020.00216.84
7.4.320.0000.00616.53
7.4.300.0000.00816.52
7.4.290.0000.00716.61
7.4.280.0080.00016.52
7.4.270.0040.00416.61
7.4.260.0040.00416.59
7.4.250.0040.00416.58
7.4.240.0000.00816.62
7.4.230.0030.00316.61
7.4.220.0030.01616.55
7.4.210.0040.01316.58
7.4.200.0050.00216.35
7.4.160.0120.00616.54
7.4.150.0110.00817.40
7.4.140.0110.01217.86
7.4.130.0100.00816.58
7.4.120.0120.00716.48
7.4.110.0090.00916.48
7.4.100.0090.00916.63
7.4.90.0100.00916.59
7.4.80.0120.00619.39
7.4.70.0130.00316.61
7.4.60.0150.00416.63
7.4.50.0100.00716.33
7.4.40.0080.00816.44
7.4.30.0110.00816.36
7.4.00.0050.01015.03
7.3.330.0070.00013.37
7.3.320.0050.00013.44
7.3.310.0070.00016.22
7.3.300.0000.00716.42
7.3.290.0030.00316.32
7.3.280.0070.01016.34
7.3.270.0100.01317.40
7.3.260.0060.01116.59
7.3.250.0070.01216.50
7.3.240.0020.01716.36
7.3.230.0100.00716.61
7.3.210.0070.01016.43
7.3.200.0250.00619.39
7.3.190.0110.00716.66
7.3.180.0090.00616.33
7.3.170.0070.01016.36
7.3.160.0070.01716.59
7.3.120.0090.00614.75
7.3.110.0070.01114.50
7.3.100.0100.00315.07
7.3.90.0030.00714.91
7.3.80.0030.01015.01
7.3.70.0070.00414.64
7.3.60.0060.01014.85
7.3.50.0000.00914.91
7.3.40.0070.00414.80
7.3.30.0030.01014.84
7.3.20.0070.00716.70
7.3.10.0030.01016.53
7.3.00.0090.00616.42
7.2.330.0070.01716.73
7.2.320.0070.01816.57
7.2.310.0100.01016.85
7.2.300.0060.01116.79
7.2.290.0070.01016.86
7.2.250.0040.01515.02
7.2.240.0060.01614.86
7.2.230.0060.00615.21
7.2.220.0120.00314.77
7.2.210.0050.00815.14
7.2.200.0030.01315.10
7.2.190.0070.01015.02
7.2.180.0040.01414.95
7.2.170.0060.00614.84
7.2.60.0040.00816.80
7.2.00.0000.01119.37
7.1.330.0070.00715.79
7.1.320.0030.01015.70
7.1.310.0080.00615.88
7.1.300.0060.00315.54
7.1.290.0040.00815.70
7.1.280.0040.00815.68
7.1.270.0070.00315.71
7.1.260.0110.00315.57
7.1.200.0080.00315.46
7.1.100.0030.00617.92
7.1.70.0040.00416.82
7.1.60.0060.00919.40
7.1.50.0110.01116.79
7.1.00.0130.06722.36
7.0.200.0270.00314.34
7.0.60.0200.08021.74
7.0.50.0130.07717.86
7.0.40.0030.05020.24
7.0.30.0270.07720.24
7.0.20.0270.04320.24
7.0.10.0070.06720.09
7.0.00.0100.07320.33
5.6.280.0030.03721.16
5.6.210.0170.07020.51
5.6.200.0100.05018.16
5.6.190.0130.07320.39
5.6.180.0300.07020.77
5.6.170.0270.05720.52
5.6.160.0030.04020.50
5.6.150.0070.07318.16
5.6.140.0070.04018.11
5.6.130.0000.05718.28
5.6.120.0030.06320.97
5.6.110.0030.05021.01
5.6.100.0100.07021.01
5.6.90.0130.06320.98
5.6.80.0070.08020.29
5.5.350.0070.04020.28
5.5.340.0100.06017.95
5.5.330.0130.07320.40
5.5.320.0600.07020.27
5.5.310.0330.07320.45
5.5.300.0030.04017.98
5.5.290.0030.08717.97
5.5.280.0070.04320.96
5.5.270.0000.07020.84
5.5.260.0100.08020.77
5.5.250.0100.06720.66
5.5.240.4270.04320.27

preferences:
54 ms | 400 KiB | 5 Q