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 from $this->getType($k); } } public function getType($type) { 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.0040.01118.27
8.3.50.0110.00416.34
8.3.40.0120.00618.75
8.3.30.0130.00318.79
8.3.20.0000.00819.11
8.3.10.0080.00021.70
8.3.00.0000.00819.41
8.2.180.0090.00916.50
8.2.170.0070.01422.96
8.2.160.0110.00420.43
8.2.150.0080.00024.18
8.2.140.0030.00524.66
8.2.130.0070.00020.35
8.2.120.0060.00326.35
8.2.110.0060.00320.35
8.2.100.0040.00817.84
8.2.90.0000.00819.34
8.2.80.0040.00418.03
8.2.70.0050.00517.63
8.2.60.0050.00317.93
8.2.50.0090.00018.10
8.2.40.0000.00720.60
8.2.30.0050.00321.16
8.2.20.0000.00718.06
8.2.10.0040.00418.20
8.2.00.0070.00018.24
8.1.280.0090.00625.92
8.1.270.0040.00422.06
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00622.04
8.1.230.0040.00717.51
8.1.220.0000.00817.76
8.1.210.0050.00318.77
8.1.200.0060.00317.35
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0050.00318.46
8.1.160.0000.00719.02
8.1.150.0040.00420.61
8.1.140.0060.00319.57
8.1.130.0000.00718.86
8.1.120.0000.00717.39
8.1.110.0000.00917.39
8.1.100.0040.00417.50
8.1.90.0000.00817.36
8.1.80.0060.00317.36
8.1.70.0000.00717.52
8.1.60.0000.00817.61
8.1.50.0050.00217.43
8.1.40.0100.00017.58
8.1.30.0000.00717.60
8.1.20.0000.00817.50
8.1.10.0040.00417.57
8.1.00.0040.00417.59
8.0.300.0030.00618.77
8.0.290.0050.00316.75
8.0.280.0030.00318.45
8.0.270.0050.00317.20
8.0.260.0060.00316.82
8.0.250.0000.00616.93
8.0.240.0000.00816.89
8.0.230.0050.00516.95
8.0.220.0070.00016.89
8.0.210.0000.00716.87
8.0.200.0030.00316.98
8.0.190.0050.00316.98
8.0.180.0000.00716.84
8.0.170.0000.00716.91
8.0.160.0060.00316.94
8.0.150.0000.00816.87
8.0.140.0080.00016.89
8.0.130.0030.00313.37
8.0.120.0030.00516.80
8.0.110.0070.00016.85
8.0.100.0040.00416.79
8.0.90.0040.00416.89
8.0.80.0070.01416.86
8.0.70.0000.00716.85
8.0.60.0000.00716.78
8.0.50.0040.00416.87
8.0.30.0110.00817.10
8.0.20.0100.01017.41
8.0.10.0000.00716.92
8.0.00.0120.00616.81
7.4.330.0000.00515.55
7.4.320.0070.00016.52
7.4.300.0000.00616.60
7.4.290.0000.00716.53
7.4.280.0040.00416.50
7.4.270.0000.00816.41
7.4.260.0070.00013.30
7.4.250.0030.00316.38
7.4.240.0030.00516.63
7.4.230.0030.00316.71
7.4.220.0130.00616.61
7.4.210.0080.00916.54
7.4.200.0000.00716.27
7.4.160.0060.01216.51
7.4.150.0070.01017.40
7.4.140.0180.00717.86
7.4.130.0060.01616.35
7.4.120.0130.00916.44
7.4.110.0060.01116.61
7.4.100.0090.00916.55
7.4.90.0030.01316.66
7.4.80.0070.01519.39
7.4.70.0040.01216.64
7.4.60.0130.01016.68
7.4.50.0120.00316.30
7.4.40.0100.01016.37
7.4.30.0030.01516.55
7.4.00.0080.00814.87
7.3.330.0000.00613.22
7.3.320.0000.00513.25
7.3.310.0050.00216.45
7.3.300.0040.00416.43
7.3.290.0030.00316.39
7.3.280.0090.00616.36
7.3.270.0040.01417.40
7.3.260.0070.00916.58
7.3.250.0090.00916.46
7.3.240.0030.01416.41
7.3.230.0120.00616.41
7.3.210.0100.00716.40
7.3.200.0000.01616.32
7.3.190.0140.00316.46
7.3.180.0040.01216.65
7.3.170.0060.01116.49
7.3.160.0080.00816.51
7.2.330.0090.00916.64
7.2.320.0130.00716.79
7.2.310.0150.00316.80
7.2.300.0070.01016.76
7.2.290.0110.00716.79
7.2.60.0060.00916.83
7.2.00.0000.01219.48
7.1.200.0060.00315.69
7.1.100.0070.01018.22
7.1.70.0000.00717.18
7.1.60.0230.02333.22
7.1.50.0230.02732.91
7.1.40.0200.01332.57
7.1.30.0270.01732.59
7.1.20.0330.03032.66
7.1.10.0130.01014.82
7.1.00.0130.01314.83
7.0.200.0100.01315.06
7.0.190.0370.01315.08
7.0.180.0630.01014.36
7.0.170.4830.01714.64
7.0.160.0370.01314.57
7.0.150.0430.01314.53
7.0.140.0130.01314.58
7.0.130.1630.01714.79
7.0.120.0100.01314.48
7.0.110.4870.00714.28
7.0.100.5170.02014.57
7.0.90.0100.01314.38
7.0.80.0070.01014.45
7.0.70.5870.01714.36
7.0.60.0130.01014.14
7.0.50.0100.01314.70
7.0.40.5770.01314.71
7.0.30.5130.01714.65
7.0.20.0230.01014.66
7.0.10.0130.00714.51
7.0.00.0130.01014.79

preferences:
58.58 ms | 401 KiB | 5 Q