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 = []; public function __construct() { for($i=0; $i < 100; $i++) { self::$a = self::$a + range('A', 'Z'); } } 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.0040.01218.28
8.3.50.0130.00616.26
8.3.40.0130.01018.97
8.3.30.0150.00418.84
8.3.20.0080.00020.91
8.3.10.0040.00421.73
8.3.00.0040.00419.48
8.2.180.0140.00718.16
8.2.170.0140.00722.96
8.2.160.0130.00720.33
8.2.150.0040.00425.66
8.2.140.0030.00624.66
8.2.130.0070.00020.43
8.2.120.0080.00026.35
8.2.110.0030.00620.47
8.2.100.0040.00817.84
8.2.90.0000.00819.27
8.2.80.0040.00418.04
8.2.70.0000.00817.63
8.2.60.0060.00317.93
8.2.50.0080.00018.10
8.2.40.0000.00822.27
8.2.30.0040.00421.07
8.2.20.0000.00818.07
8.2.10.0040.00418.21
8.2.00.0000.00718.24
8.1.280.0180.00325.92
8.1.270.0090.00923.80
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0040.00720.89
8.1.230.0080.00419.01
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0060.00317.35
8.1.190.0070.00017.10
8.1.180.0030.00518.10
8.1.170.0030.00618.71
8.1.160.0070.00019.04
8.1.150.0040.00420.72
8.1.140.0040.00819.48
8.1.130.0030.00318.83
8.1.120.0040.00417.45
8.1.110.0050.00317.46
8.1.100.0060.00317.49
8.1.90.0030.00617.45
8.1.80.0030.00617.52
8.1.70.0050.00317.50
8.1.60.0060.00317.64
8.1.50.0000.00717.44
8.1.40.0060.00617.43
8.1.30.0060.00317.65
8.1.20.0060.00617.59
8.1.10.0080.00017.62
8.1.00.0000.00817.57
8.0.300.0050.00318.77
8.0.290.0050.00216.88
8.0.280.0020.00518.40
8.0.270.0000.00717.16
8.0.260.0070.00016.91
8.0.250.0000.00816.95
8.0.240.0040.00417.03
8.0.230.0030.00317.01
8.0.220.0030.00316.97
8.0.210.0030.00516.99
8.0.200.0060.00016.97
8.0.190.0050.00316.88
8.0.180.0050.00317.07
8.0.170.0040.00417.00
8.0.160.0000.00717.02
8.0.150.0030.00616.91
8.0.140.0000.00716.92
8.0.130.0060.00013.42
8.0.120.0030.00516.97
8.0.110.0040.00416.89
8.0.100.0020.00516.98
8.0.90.0030.00516.93
8.0.80.0060.01517.02
8.0.70.0040.00416.95
8.0.60.0040.00417.04
8.0.50.0000.00816.96
8.0.30.0110.00717.17
8.0.20.0120.00917.40
8.0.10.0070.00017.07
8.0.00.0140.00316.87
7.4.330.0020.00215.55
7.4.320.0000.00716.56
7.4.300.0030.00316.54
7.4.290.0100.00016.63
7.4.280.0040.00416.52
7.4.270.0000.00716.61
7.4.260.0030.00313.30
7.4.250.0000.00716.52
7.4.240.0040.00416.48
7.4.230.0030.00316.54
7.4.220.0110.00716.68
7.4.210.0100.00616.57
7.4.200.0030.00516.73
7.4.160.0030.01316.53
7.4.150.0070.01117.40
7.4.140.0100.01017.86
7.4.130.0110.01416.53
7.4.120.0080.01216.55
7.4.110.0120.00616.56
7.4.100.0110.00616.64
7.4.90.0060.01216.68
7.4.80.0180.00019.39
7.4.70.0050.01116.61
7.4.60.0070.01016.58
7.4.50.0030.01516.56
7.4.40.0120.01216.50
7.4.30.0100.00716.52
7.4.00.0000.01215.10
7.3.330.0030.00413.42
7.3.320.0000.00513.27
7.3.310.0040.00416.26
7.3.300.0000.00716.24
7.3.290.0110.00416.45
7.3.280.0070.01016.37
7.3.270.0120.00617.40
7.3.260.0030.01316.58
7.3.250.0100.00816.41
7.3.240.0050.01216.63
7.3.230.0120.00316.75
7.3.210.0080.00916.37
7.3.200.0000.01816.45
7.3.190.0170.00016.43
7.3.180.0140.00316.35
7.3.170.0100.01116.48
7.3.160.0090.00616.47
7.2.330.0150.00316.85
7.2.320.0110.00716.73
7.2.310.0130.00316.70
7.2.300.0100.01316.58
7.2.290.0030.01316.59
7.2.00.0240.00918.71
7.1.100.0100.00717.96
7.1.70.0040.00417.34
7.1.60.2600.02033.25
7.1.50.2570.02732.93
7.1.40.1870.02332.54
7.1.30.3130.01732.60
7.1.20.2200.01332.65
7.1.10.1970.02315.01
7.1.00.1530.01014.79
7.0.200.3300.01714.85
7.0.190.2970.01314.63
7.0.180.2200.01314.42
7.0.170.2170.01014.44
7.0.160.1670.00714.42
7.0.150.1600.02014.44
7.0.140.1900.00714.43
7.0.130.2830.00714.94
7.0.120.1700.01014.57
7.0.110.1630.01014.60
7.0.100.1430.01014.68
7.0.90.2100.01014.30
7.0.80.1770.01714.64
7.0.70.1870.01014.30
7.0.60.1600.01014.30
7.0.50.2270.01314.46
7.0.40.0200.02014.76
7.0.30.1730.01714.70
7.0.20.1970.01314.46
7.0.10.1600.01014.49
7.0.00.2200.01014.67

preferences:
44.07 ms | 400 KiB | 5 Q