3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); namespace App; use Generator; use CachingIterator; class Foo {} $generator = /** * @return Generator<bool, bool> */ static function (): Generator { yield true => true; yield false => false; yield "foo" => new Foo(); yield "bar" => new Foo(); yield "baz" => new Foo(); }; $iterator = new CachingIterator($generator(), CachingIterator::FULL_CACHE | CachingIterator::CALL_TOSTRING); foreach ($iterator as $k => $v) { var_dump($k, $v); } foreach ($iterator->getCache() as $k => $v) { var_dump($k, $v); }

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.5.00.0120.00922.78
8.4.150.0030.00014.05
8.4.140.0550.02265.85
8.4.130.0300.03066.04
8.4.120.0430.03565.82
8.4.110.0480.02467.14
8.4.100.0430.04166.99
8.4.90.0390.02768.64
8.4.80.0410.03867.17
8.4.70.0520.03265.96
8.4.60.0530.03568.50
8.4.50.0430.03166.04
8.4.40.0360.04066.18
8.4.30.0560.03667.04
8.4.20.0490.03366.12
8.4.10.0640.01070.09
8.3.280.0790.04563.18
8.3.270.0500.04864.83
8.3.260.0390.04564.68
8.3.250.0490.02464.68
8.3.240.0470.03765.09
8.3.230.0380.04464.56
8.3.220.0760.03466.99
8.3.210.0390.03365.03
8.3.200.0410.01964.70
8.3.190.0410.03468.82
8.3.180.0440.02564.77
8.3.170.0460.02964.89
8.3.160.0640.04864.91
8.3.150.0570.01765.39
8.3.140.0690.03064.87
8.3.130.0250.03565.09
8.3.120.0100.02368.72
8.3.110.0550.01065.04
8.3.100.0170.03465.13
8.3.90.0390.02966.81
8.3.80.0530.02364.67
8.3.70.0680.05264.89
8.3.60.0810.03564.70
8.3.50.0470.03766.64
8.3.40.0270.02746.09
8.3.30.0310.02742.95
8.3.20.0200.01046.05
8.3.10.0240.00646.35
8.3.00.0100.02146.43
8.2.290.0510.03068.37
8.2.280.0460.03867.09
8.2.270.0390.01665.58
8.2.260.0440.04170.55
8.2.250.0260.02664.96
8.2.240.0310.02465.18
8.2.230.0200.03464.73
8.2.220.0330.02664.72
8.2.210.0230.02366.87
8.2.200.0390.02065.11
8.2.190.0370.06064.70
8.2.180.0770.04065.29
8.2.170.0460.02043.19
8.2.160.0170.01746.17
8.2.150.0130.01344.77
8.2.140.0200.01044.53
8.2.130.0140.01442.63
8.2.120.0070.01143.64
8.2.110.0230.01644.45
8.2.100.0260.02041.84
8.2.90.0070.02341.78
8.2.80.0090.01845.03
8.2.70.0160.01641.59
8.2.60.0140.02141.93
8.2.50.0250.00741.61
8.2.40.0130.01742.25
8.2.30.0140.01742.11
8.2.20.0200.01044.42
8.2.10.0040.03141.90
8.2.00.0170.01743.23
8.1.330.0450.02970.07
8.1.320.0490.03064.52
8.1.310.0400.02465.39
8.1.300.0660.03064.46
8.1.290.0290.02664.55
8.1.280.0620.04165.94
8.1.270.0130.01646.61
8.1.260.0090.00943.21
8.1.250.0190.01346.40
8.1.240.0320.01344.93
8.1.230.0260.01646.13
8.1.220.0160.01341.80
8.1.210.0170.01742.77
8.1.200.0130.01741.47
8.1.190.0130.01741.43
8.1.180.0240.00841.48
8.1.170.0240.02142.38
8.1.160.0190.01042.88
8.1.150.0100.02742.61
8.1.140.0070.02341.40
8.1.130.0000.02842.78
8.1.120.0140.01741.46
8.1.110.0140.01741.42
8.1.100.0070.02141.44
8.1.90.0210.01141.44
8.1.80.0210.01541.32
8.1.70.0180.01841.31
8.1.60.0270.01241.46
8.1.50.0210.01841.43
8.1.40.0180.02241.39
8.1.30.0310.00841.47
8.1.20.0110.02841.40
8.1.10.0330.03365.63
8.1.00.0270.03365.63
8.0.300.0170.04068.10
8.0.290.0170.03464.77
8.0.280.0270.03466.37
8.0.270.0170.03766.10
8.0.260.0200.03066.46
8.0.250.0160.03364.94
8.0.240.0200.04665.02
8.0.230.0360.02664.88
8.0.220.0330.02364.98
8.0.210.0300.03764.85
8.0.200.0240.03564.89
8.0.190.0400.01864.86
8.0.180.0140.04464.83
8.0.170.0310.02864.82
8.0.160.0270.03165.01
8.0.150.0300.02764.89
8.0.140.0340.02264.89
8.0.130.0220.03364.80
8.0.120.0170.03764.91
8.0.110.0210.03564.89
8.0.100.0380.02164.88
8.0.90.0200.03664.83
8.0.80.0250.03164.80
8.0.70.0200.04164.84
8.0.60.0200.03764.74
8.0.50.0280.02964.86
8.0.30.0370.02064.92
8.0.20.0280.02864.85
8.0.10.0300.02664.98
7.4.330.0260.03061.26
7.4.320.0220.03264.57
7.4.300.0200.03064.43
7.4.290.0180.03964.40
7.4.280.0240.03464.40
7.4.270.0280.02864.48
7.4.260.0190.04264.32
7.4.250.0280.02864.48
7.4.240.0130.04164.39
7.4.230.0230.03364.36
7.4.220.0250.03064.30
7.4.210.0200.03464.48
7.4.200.0230.03364.46
7.4.190.0190.03864.54
7.4.180.0160.03964.56
7.4.160.0270.03064.49
7.4.150.0170.04064.41
7.4.140.0270.03064.40
7.4.130.0300.02664.28
7.4.120.0140.03964.21
7.4.110.0190.03564.19
7.4.100.0260.02964.41
7.4.90.0290.02664.23
7.4.80.0320.02564.40
7.4.70.0280.03064.44
7.4.60.0390.01764.45
7.4.50.0290.02964.27
7.4.40.0260.02664.34
7.4.30.0250.02864.26
7.4.20.0200.03564.43
7.4.10.0200.03164.26
7.4.00.0370.01764.51

preferences:
35.47 ms | 403 KiB | 5 Q