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 = array_merge(self::$a, range('A', 'Z')); } } public function generator() { self::$a = array_reverse(self::$a); while(self::$a) { yield array_pop(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.0160.00318.43
8.3.50.0150.00616.52
8.3.40.0210.00318.96
8.3.30.0100.01018.95
8.3.20.0040.00720.79
8.3.10.0070.00321.88
8.3.00.0070.00719.60
8.2.180.0140.00718.41
8.2.170.0140.00722.96
8.2.160.0070.01320.48
8.2.150.0070.00424.18
8.2.140.0070.00424.66
8.2.130.0030.00722.25
8.2.120.0070.00426.35
8.2.110.0080.00422.12
8.2.100.0130.00317.84
8.2.90.0060.00317.97
8.2.80.0040.00717.97
8.2.70.0060.00317.75
8.2.60.0060.00318.17
8.2.50.0030.00718.10
8.2.40.0030.00622.19
8.2.30.0000.01019.40
8.2.20.0060.00318.17
8.2.10.0030.00718.24
8.2.00.0000.00918.27
8.1.280.0200.00725.92
8.1.270.0200.00323.88
8.1.260.0100.00026.35
8.1.250.0070.00428.09
8.1.240.0090.00322.30
8.1.230.0100.00521.17
8.1.220.0100.00018.04
8.1.210.0060.00319.13
8.1.200.0040.00717.72
8.1.190.0000.00917.47
8.1.180.0030.00618.10
8.1.170.0030.00718.90
8.1.160.0030.00619.31
8.1.150.0060.00320.55
8.1.140.0060.00619.83
8.1.130.0000.00919.05
8.1.120.0090.00017.69
8.1.110.0040.00717.69
8.1.100.0060.00317.73
8.1.90.0030.00617.61
8.1.80.0070.00417.60
8.1.70.0030.00717.59
8.1.60.0070.00417.88
8.1.50.0070.00317.82
8.1.40.0100.00317.80
8.1.30.0070.00317.88
8.1.20.0060.00917.91
8.1.10.0060.00317.87
8.1.00.0030.00617.71
8.0.300.0030.00720.03
8.0.290.0030.00616.88
8.0.280.0000.00918.68
8.0.270.0060.00317.57
8.0.260.0030.00617.12
8.0.250.0040.00417.26
8.0.240.0070.00417.21
8.0.230.0060.00317.19
8.0.220.0030.00617.16
8.0.210.0060.00317.16
8.0.200.0030.00617.24
8.0.190.0090.00017.22
8.0.180.0040.00417.23
8.0.170.0030.00717.14
8.0.160.0000.00917.17
8.0.150.0030.00616.93
8.0.140.0070.00317.04
8.0.130.0000.00713.66
8.0.120.0040.00717.06
8.0.110.0000.00917.00
8.0.100.0000.00917.07
8.0.90.0040.00417.04
8.0.80.0160.00917.17
8.0.70.0090.00016.97
8.0.60.0050.00517.02
8.0.50.0030.00616.99
8.0.30.0220.01517.33
8.0.20.0180.01817.40
8.0.10.0000.00917.24
8.0.00.0260.00916.99
7.4.330.0070.00015.55
7.4.320.0040.00416.87
7.4.300.0030.00516.88
7.4.290.0100.00316.88
7.4.280.0050.00516.88
7.4.270.0000.00916.66
7.4.260.0070.00013.59
7.4.250.0000.00916.71
7.4.240.0000.00916.77
7.4.230.0060.00316.61
7.4.220.0080.02016.78
7.4.210.0150.00616.78
7.4.200.0000.00816.80
7.4.160.0270.01116.79
7.4.150.0180.01217.40
7.4.140.0400.01217.86
7.4.130.0140.01816.89
7.4.120.0300.01816.79
7.4.110.0160.01616.89
7.4.100.0140.01716.82
7.4.90.0070.02316.81
7.4.80.0220.01919.39
7.4.70.0280.00716.74
7.4.60.0130.01416.78
7.4.50.0100.01016.84
7.4.40.0160.01116.84
7.4.30.0190.00616.75
7.4.00.0140.00715.08
7.3.330.0030.00613.45
7.3.320.0040.00413.58
7.3.310.0070.00316.52
7.3.300.0060.00316.57
7.3.290.0070.01716.64
7.3.280.0140.01416.61
7.3.270.0170.01417.40
7.3.260.0210.01116.68
7.3.250.0300.01416.65
7.3.240.0190.01816.58
7.3.230.0250.01416.67
7.3.210.0160.01616.67
7.3.200.0110.02216.86
7.3.190.0220.01216.68
7.3.180.0130.01816.70
7.3.170.0120.02416.80
7.3.160.0130.01316.61
7.2.330.0180.01417.00
7.2.320.0200.01316.97
7.2.310.0130.01316.98
7.2.300.0160.02317.05
7.2.290.0110.02016.93
7.2.00.0290.00718.96
7.1.200.0060.01315.57
7.1.100.0120.00617.80
7.1.70.0000.00917.02
7.1.60.2770.02033.32
7.1.50.3600.01733.14
7.1.40.3730.02332.83
7.1.30.4800.01332.85
7.1.20.0970.01332.85
7.1.10.2930.02014.99
7.1.00.3130.01715.20
7.0.200.3730.03715.43
7.0.190.4600.01015.19
7.0.180.2330.02014.77
7.0.170.3570.01314.79
7.0.160.1430.01714.89
7.0.150.1700.02014.93
7.0.140.2770.02014.85
7.0.130.2670.03315.16
7.0.120.2730.00715.13
7.0.110.2800.01314.86
7.0.100.2900.02315.09
7.0.90.2630.01715.01
7.0.80.2500.03014.86
7.0.70.3200.02314.54
7.0.60.2570.01714.66
7.0.50.2370.02014.64
7.0.40.2130.01714.90
7.0.30.2130.02315.16
7.0.20.2830.02014.80
7.0.10.2270.02715.02
7.0.00.2670.01714.91

preferences:
37.67 ms | 401 KiB | 5 Q