3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('error_reporting', -1); ini_set('display_errors', 'on'); class Foo { private static $a = ['b' => ['4', '5', '6'], 'c' => ['1', '2', '3']]; public function generator() { foreach (self::$a as $k => $v) { yield $this->getType($k); } } public function getType(){ foreach (self::$a[$type] as $t) { yield $t; } self::$a[$type] = []; } } $foo = new Foo; $generator = $foo->generator(); if ($generator->valid()) { foreach($generator as $i) { echo $i; } } else { echo 'Nothing'; } $generator = $foo->generator(); 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.0060.00918.42
8.3.50.0120.00316.26
8.3.40.0110.00418.85
8.3.30.0130.00318.85
8.3.20.0000.00818.97
8.3.10.0050.00321.90
8.3.00.0080.00019.54
8.2.180.0140.00316.63
8.2.170.0040.01122.96
8.2.160.0070.00720.43
8.2.150.0030.00525.66
8.2.140.0040.00424.66
8.2.130.0070.00020.34
8.2.120.0000.00726.35
8.2.110.0000.01022.21
8.2.100.0060.00617.91
8.2.90.0030.00619.05
8.2.80.0030.00517.97
8.2.70.0040.00417.75
8.2.60.0000.00817.93
8.2.50.0040.00418.10
8.2.40.0040.00420.44
8.2.30.0000.00820.91
8.2.20.0040.00418.08
8.2.10.0040.00417.96
8.2.00.0000.00718.13
8.1.280.0110.00425.92
8.1.270.0040.00422.20
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00622.76
8.1.230.0110.00017.64
8.1.220.0000.00917.76
8.1.210.0040.00418.77
8.1.200.0000.01017.47
8.1.190.0080.00017.21
8.1.180.0030.00618.10
8.1.170.0060.00318.63
8.1.160.0040.00419.04
8.1.150.0000.00820.58
8.1.140.0100.00019.64
8.1.130.0000.00718.90
8.1.120.0000.00717.38
8.1.110.0070.00017.43
8.1.100.0000.00717.50
8.1.90.0040.00417.40
8.1.80.0030.00517.50
8.1.70.0000.00817.51
8.1.60.0040.00417.61
8.1.50.0050.00217.53
8.1.40.0050.00617.57
8.1.30.0040.00417.56
8.1.20.0000.00817.67
8.1.10.0060.00317.59
8.1.00.0000.00817.49
8.0.300.0000.00818.77
8.0.290.0060.00316.75
8.0.280.0070.00018.38
8.0.270.0020.00517.30
8.0.260.0060.00316.92
8.0.250.0000.00817.02
8.0.240.0040.00416.98
8.0.230.0060.01116.96
8.0.220.0000.00716.99
8.0.210.0030.00316.92
8.0.200.0000.00616.99
8.0.190.0000.00816.93
8.0.180.0040.00417.04
8.0.170.0070.00016.88
8.0.160.0000.00916.95
8.0.150.0000.00716.86
8.0.140.0030.00316.76
8.0.130.0040.00313.35
8.0.120.0090.00016.98
8.0.110.0040.00417.03
8.0.100.0040.00416.99
8.0.90.0070.00016.84
8.0.80.0030.01616.99
8.0.70.0000.00816.96
8.0.60.0020.00516.86
8.0.50.0030.00316.93
8.0.30.0150.00516.98
8.0.20.0140.00717.40
8.0.10.0040.00417.14
8.0.00.0100.00717.04
7.4.330.0000.00515.55
7.4.320.0030.00316.48
7.4.300.0060.00016.62
7.4.290.0000.00716.67
7.4.280.0000.00816.61
7.4.270.0080.00016.52
7.4.260.0070.00016.52
7.4.250.0000.00716.53
7.4.240.0000.00716.45
7.4.230.0000.00716.59
7.4.220.0150.00316.59
7.4.210.0080.00716.58
7.4.200.0030.00316.42
7.4.160.0070.00816.62
7.4.150.0040.01417.40
7.4.140.0130.01017.86
7.4.130.0090.00916.53
7.4.120.0080.01016.61
7.4.110.0100.01016.52
7.4.100.0090.00916.64
7.4.90.0140.00916.59
7.4.80.0140.01019.39
7.4.70.0090.00616.35
7.4.60.0100.00716.57
7.4.50.0060.01016.49
7.4.40.0110.00516.74
7.4.30.0170.00016.45
7.4.00.0060.01214.82
7.3.330.0020.00213.41
7.3.320.0030.00313.40
7.3.310.0070.00016.21
7.3.300.0030.00316.41
7.3.290.0000.00716.39
7.3.280.0090.00916.37
7.3.270.0270.02117.40
7.3.260.0110.00816.49
7.3.250.0120.00916.44
7.3.240.0050.01216.52
7.3.230.0100.00716.66
7.3.210.0100.00716.39
7.3.200.0130.00416.58
7.3.190.0100.00716.46
7.3.180.0060.01416.55
7.3.170.0180.00616.51
7.3.160.0090.00616.35
7.2.330.0070.01116.72
7.2.320.0090.00916.46
7.2.310.0100.00716.79
7.2.300.0110.00716.73
7.2.290.0130.00616.60
7.2.60.0090.00616.37
7.2.00.0030.00619.33
7.1.200.0070.00315.82
7.1.100.0130.01018.02
7.1.70.0070.00317.29
7.1.60.0370.01333.23
7.1.50.2270.01332.76
7.1.40.4330.01032.67
7.1.30.4630.01332.60
7.1.20.4030.01332.77
7.1.10.2170.00714.92
7.1.00.2530.01014.70
7.0.200.0070.01014.90
7.0.190.3700.01714.86
7.0.180.0070.01314.40
7.0.170.4500.00714.32
7.0.160.3630.01314.48
7.0.150.2600.01314.44
7.0.140.3700.01314.71
7.0.130.2030.01014.45
7.0.120.1970.01314.72
7.0.110.1670.01314.60
7.0.100.2730.01714.70
7.0.90.1500.01714.51
7.0.80.1400.01014.74
7.0.70.1570.00714.57
7.0.60.2370.01314.29
7.0.50.2000.01014.53
7.0.40.1700.01014.92
7.0.30.1830.01014.82
7.0.20.0400.01314.76
7.0.10.0070.01014.56
7.0.00.0070.01014.51

preferences:
52.03 ms | 401 KiB | 5 Q