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 = ['a', 'b']; public function generator() { foreach(self::$a as $i){ yield $i; } //self::$a = []; } } $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.0100.00716.75
8.3.50.0130.00616.49
8.3.40.0110.00318.56
8.3.30.0040.01118.59
8.3.20.0040.00419.02
8.3.10.0040.00421.95
8.3.00.0060.00319.35
8.2.180.0100.00718.17
8.2.170.0120.00922.96
8.2.160.0060.00820.57
8.2.150.0050.00325.66
8.2.140.0040.00424.66
8.2.130.0040.00420.52
8.2.120.0040.00426.35
8.2.110.0000.01120.45
8.2.100.0000.01217.59
8.2.90.0040.00419.26
8.2.80.0080.00018.04
8.2.70.0040.00417.50
8.2.60.0000.00818.04
8.2.50.0000.00818.10
8.2.40.0090.00022.11
8.2.30.0000.00721.06
8.2.20.0000.00718.09
8.2.10.0050.00318.12
8.2.00.0030.00617.93
8.1.280.0090.00625.92
8.1.270.0080.00023.84
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0000.00922.05
8.1.230.0060.00619.17
8.1.220.0050.00317.79
8.1.210.0000.00818.77
8.1.200.0030.00717.35
8.1.190.0060.00317.35
8.1.180.0080.00018.10
8.1.170.0050.00318.51
8.1.160.0000.00718.93
8.1.150.0030.00520.71
8.1.140.0060.00619.45
8.1.130.0000.00718.91
8.1.120.0080.00017.31
8.1.110.0040.00417.48
8.1.100.0050.00317.43
8.1.90.0080.00417.34
8.1.80.0040.00417.49
8.1.70.0000.00817.44
8.1.60.0000.00717.58
8.1.50.0030.00517.40
8.1.40.0000.00817.50
8.1.30.0040.00417.61
8.1.20.0000.00717.64
8.1.10.0040.00417.53
8.1.00.0040.00417.58
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0000.00718.36
8.0.270.0090.00017.14
8.0.260.0060.00016.70
8.0.250.0040.00416.93
8.0.240.0050.00216.89
8.0.230.0000.00816.93
8.0.220.0070.00016.91
8.0.210.0030.00616.81
8.0.200.0030.00316.90
8.0.190.0040.00416.95
8.0.180.0040.00416.91
8.0.170.0040.00416.79
8.0.160.0000.00816.81
8.0.150.0000.00816.81
8.0.140.0040.00416.85
8.0.130.0000.00613.25
8.0.120.0000.00716.75
8.0.110.0070.00016.96
8.0.100.0000.00716.77
8.0.90.0020.00516.89
8.0.80.0160.00816.84
8.0.70.0040.00416.85
8.0.60.0020.00516.79
8.0.50.0040.00416.81
8.0.30.0070.01116.86
8.0.20.0130.00717.40
8.0.10.0070.00016.82
8.0.00.0170.00016.76
7.4.330.0030.00315.55
7.4.320.0060.00016.51
7.4.300.0000.00616.53
7.4.290.0070.00316.64
7.4.280.0000.00816.58
7.4.270.0000.00716.51
7.4.260.0050.00013.34
7.4.250.0030.00316.49
7.4.240.0000.00716.52
7.4.230.0040.00416.52
7.4.220.0130.00616.67
7.4.210.0050.01016.72
7.4.200.0030.00316.70
7.4.160.0070.01216.68
7.4.150.0160.00317.40
7.4.140.0090.01317.86
7.4.130.0140.01116.42
7.4.120.0080.01016.45
7.4.110.0110.00716.45
7.4.100.0090.00916.58
7.4.90.0120.00616.54
7.4.80.0120.00419.39
7.4.70.0110.00516.37
7.4.60.0100.01016.56
7.4.50.0070.00716.43
7.4.40.0040.01216.55
7.4.30.0070.01016.32
7.4.00.0050.01215.18
7.3.330.0050.00013.38
7.3.320.0050.00013.47
7.3.310.0040.00416.43
7.3.300.0030.00316.34
7.3.290.0100.00516.36
7.3.280.0060.01016.39
7.3.270.0060.01317.40
7.3.260.0090.00916.42
7.3.250.0110.00916.43
7.3.240.0070.01116.67
7.3.230.0070.01016.45
7.3.210.0070.01016.55
7.3.200.0070.01016.37
7.3.190.0080.00816.72
7.3.180.0030.01316.64
7.3.170.0150.00716.46
7.3.160.0100.00716.50
7.3.120.0020.01614.71
7.3.110.0100.00815.02
7.3.100.0080.00614.82
7.3.90.0030.00914.90
7.3.80.0050.00714.77
7.3.70.0090.00814.81
7.3.60.0040.00914.81
7.3.50.0060.00614.80
7.3.40.0050.00814.71
7.3.30.0040.00914.91
7.3.20.0080.00616.66
7.3.10.0050.00716.66
7.3.00.0080.00616.74
7.2.330.0180.00016.52
7.2.320.0100.01016.57
7.2.310.0100.00716.65
7.2.300.0090.01216.79
7.2.290.0070.01016.83
7.2.250.0030.01715.24
7.2.240.0100.00714.86
7.2.230.0080.00815.30
7.2.220.0070.00714.90
7.2.210.0050.00915.04
7.2.200.0080.00514.87
7.2.190.0090.00515.14
7.2.180.0070.00515.03
7.2.170.0040.01015.03
7.2.160.0050.00514.80
7.2.150.0060.00917.06
7.2.140.0080.00816.77
7.2.130.0100.01017.11
7.2.120.0080.00316.64
7.2.110.0110.00317.00
7.2.100.0030.01317.03
7.2.90.0040.01117.16
7.2.80.0030.01417.05
7.2.70.0030.01017.15
7.2.60.0050.01116.95
7.2.50.0070.00716.96
7.2.40.0030.01316.93
7.2.30.0040.00817.15
7.2.20.0070.00616.82
7.2.10.0070.00317.04
7.2.00.0060.00618.07
7.1.330.0060.01115.81
7.1.320.0080.00515.86
7.1.310.0070.00715.87
7.1.300.0080.00615.67
7.1.290.0080.00515.55
7.1.280.0070.00615.80
7.1.270.0050.01015.64
7.1.260.0060.00915.65
7.1.250.0130.00315.78
7.1.200.0090.00315.76
7.1.100.0100.00618.28
7.1.70.0000.00817.26
7.1.60.3230.01033.35
7.1.50.2470.02332.78
7.1.40.2000.01332.54
7.1.30.3870.01732.77
7.1.20.2030.01332.81
7.1.10.1570.01314.70
7.1.00.3030.01314.75
7.0.200.3300.00715.09
7.0.190.2400.01314.92
7.0.180.2270.01014.56
7.0.170.3600.01314.43
7.0.160.0870.01014.37
7.0.150.1930.01314.56
7.0.140.2470.01314.29
7.0.130.3100.01014.63
7.0.120.2100.00714.62
7.0.110.2600.01014.69
7.0.100.1000.01014.46
7.0.90.0230.01314.57
7.0.80.3500.00714.77
7.0.70.2400.02014.56
7.0.60.0700.01314.46
7.0.50.0830.02014.77
7.0.40.0600.02314.86
7.0.30.0070.01714.71
7.0.20.1500.02714.52
7.0.10.0130.01014.65
7.0.00.0030.01314.70

preferences:
55.56 ms | 400 KiB | 5 Q