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() { self::$a = range('A', 'Z'); } public function generator() { while(self::$a) { yield array_reverse(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.0070.00718.55
8.3.50.0130.00616.50
8.3.40.0100.00318.96
8.3.30.0110.00418.93
8.3.20.0040.00420.85
8.3.10.0080.00021.76
8.3.00.0040.00419.65
8.2.180.0070.01418.66
8.2.170.0100.00722.96
8.2.160.0170.00320.45
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0040.00420.52
8.2.120.0030.00626.35
8.2.110.0000.00922.27
8.2.100.0080.00418.03
8.2.90.0080.00019.17
8.2.80.0000.00818.15
8.2.70.0030.00617.63
8.2.60.0080.00018.04
8.2.50.0000.00918.10
8.2.40.0000.00822.15
8.2.30.0000.00820.90
8.2.20.0040.00418.08
8.2.10.0000.00717.93
8.2.00.0000.00718.07
8.1.280.0090.00925.92
8.1.270.0050.00323.92
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0130.00623.98
8.1.230.0070.00322.18
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0100.00017.35
8.1.190.0000.00817.10
8.1.180.0050.00318.10
8.1.170.0100.00018.54
8.1.160.0040.00419.10
8.1.150.0000.00820.48
8.1.140.0060.00619.41
8.1.130.0000.00718.86
8.1.120.0050.00217.31
8.1.110.0050.00217.39
8.1.100.0000.00817.42
8.1.90.0000.00817.46
8.1.80.0070.00317.31
8.1.70.0000.00717.33
8.1.60.0040.00417.63
8.1.50.0000.00717.45
8.1.40.0070.00317.54
8.1.30.0000.00817.61
8.1.20.0100.00317.36
8.1.10.0040.00417.61
8.1.00.0000.00817.55
8.0.300.0070.00318.77
8.0.290.0050.00216.75
8.0.280.0000.00718.29
8.0.270.0000.00817.16
8.0.260.0050.00316.79
8.0.250.0050.00317.02
8.0.240.0000.00716.96
8.0.230.0030.00316.91
8.0.220.0000.00716.86
8.0.210.0030.00616.78
8.0.200.0000.00716.96
8.0.190.0000.00816.98
8.0.180.0000.00816.90
8.0.170.0030.00316.95
8.0.160.0070.00016.96
8.0.150.0000.00816.82
8.0.140.0000.00716.92
8.0.130.0030.00313.31
8.0.120.0040.00416.86
8.0.110.0030.00616.99
8.0.100.0040.00416.82
8.0.90.0040.00416.96
8.0.80.0120.00616.95
8.0.70.0040.00416.71
8.0.60.0000.00716.70
8.0.50.0040.00416.74
8.0.30.0100.00817.24
8.0.20.0090.01117.40
8.0.10.0000.00716.86
8.0.00.0070.01016.89
7.4.330.0030.00315.55
7.4.320.0030.00316.51
7.4.300.0040.00416.61
7.4.290.0040.00416.54
7.4.280.0030.00616.51
7.4.270.0030.00516.55
7.4.260.0060.00013.25
7.4.250.0000.00716.38
7.4.240.0050.00316.45
7.4.230.0000.00716.55
7.4.220.0110.00716.61
7.4.210.0040.01116.43
7.4.200.0030.00516.44
7.4.160.0040.01216.51
7.4.150.0040.01417.40
7.4.140.0160.00417.86
7.4.130.0100.01016.77
7.4.120.0080.01016.59
7.4.110.0100.00716.39
7.4.100.0120.00616.57
7.4.90.0110.00716.57
7.4.80.0090.00919.39
7.4.70.0070.01016.28
7.4.60.0100.00616.60
7.4.50.0070.01016.62
7.4.40.0130.00916.48
7.4.30.0080.00816.59
7.4.00.0090.00715.07
7.3.330.0080.00013.41
7.3.320.0060.00013.33
7.3.310.0080.00016.42
7.3.300.0030.00316.43
7.3.290.0100.00816.40
7.3.280.0100.00916.36
7.3.270.0140.00417.40
7.3.260.0130.00316.36
7.3.250.0070.01116.46
7.3.240.0090.00816.48
7.3.230.0170.00016.50
7.3.210.0060.01216.64
7.3.200.0080.00816.34
7.3.190.0070.01116.38
7.3.180.0120.00616.53
7.3.170.0060.01516.41
7.3.160.0070.01016.44
7.3.120.0060.01215.07
7.3.110.0110.00314.66
7.3.100.0100.00714.96
7.3.90.0150.00314.78
7.3.80.0090.00614.55
7.3.70.0030.01014.95
7.3.60.0060.00914.77
7.3.50.0120.00414.57
7.3.40.0040.00414.70
7.3.30.0030.01014.88
7.3.20.0070.01116.64
7.3.10.0070.00716.41
7.3.00.0000.01316.56
7.2.330.0180.00416.80
7.2.320.0100.00816.62
7.2.310.0120.01216.51
7.2.300.0030.01516.80
7.2.290.0120.00916.50
7.2.250.0080.01115.28
7.2.240.0030.01715.11
7.2.230.0130.00715.36
7.2.220.0000.01415.18
7.2.210.0060.00915.23
7.2.200.0060.00914.90
7.2.190.0000.01515.00
7.2.180.0070.00714.89
7.2.170.0030.01315.09
7.2.60.0040.01117.02
7.2.00.0110.00719.46
7.1.330.0030.01015.87
7.1.320.0030.01015.93
7.1.310.0060.01215.91
7.1.300.0070.00715.69
7.1.290.0030.00715.55
7.1.280.0080.00415.94
7.1.270.0130.00315.70
7.1.260.0060.00316.04
7.1.200.0090.00315.62
7.1.100.0030.01018.19
7.1.70.0030.00717.14
7.1.60.2600.01333.37
7.1.50.2130.02332.92
7.1.40.2230.01032.49
7.1.30.1300.02732.78
7.1.20.3470.02032.76
7.1.10.2470.01314.87
7.1.00.2570.01315.03
7.0.200.2870.01715.09
7.0.190.2200.01714.99
7.0.180.2570.02314.50
7.0.170.0070.01714.33
7.0.160.3200.01314.35
7.0.150.0170.01314.50
7.0.140.1100.00714.46
7.0.130.0070.01314.60
7.0.120.0500.01714.73
7.0.110.1230.01014.61
7.0.100.2500.01314.32
7.0.90.2230.01314.46
7.0.80.2400.01314.43
7.0.70.0130.01014.39
7.0.60.0070.01314.43
7.0.50.0000.02014.55
7.0.40.0130.01014.76
7.0.30.2400.01014.52
7.0.20.0130.01314.73
7.0.10.2470.02014.68
7.0.00.0130.00714.61

preferences:
30.57 ms | 400 KiB | 5 Q