3v4l.org

run code in 500+ PHP versions simultaneously
<?php function arrayProvider() { yield [ 'one', 'two', 'three', ]; yield [ 'four', 'five', 'six', ]; yield [ 'seven', 'eight', 'nine', ]; } function iterateValues(array $array) { foreach ($array as $value) { yield $value; } } function g1() { foreach (arrayProvider() as $array) { $iterator = iterateValues($array); if ($iterator?->valid()) { yield from $iterator; } } } function g2() { yield from g1(); } foreach (g2() as $s) { echo $s . PHP_EOL; }

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.90.0090.00916.76
8.5.80.0130.00716.78
8.5.70.0080.00516.63
8.5.60.0080.00216.72
8.5.50.0030.00416.64
8.5.30.0080.00921.22
8.5.20.0090.00520.09
8.5.10.0100.00816.53
8.5.00.0130.00721.79
8.4.240.0110.01419.43
8.4.230.0040.00519.49
8.4.220.0110.00319.40
8.4.210.0110.00919.39
8.4.180.0060.00419.67
8.4.170.0140.00721.83
8.4.160.0090.00622.04
8.4.150.0100.00416.84
8.4.140.0120.01017.60
8.4.130.0120.00819.03
8.4.120.0090.01217.95
8.4.110.0110.00419.82
8.4.100.0150.00617.97
8.4.90.0110.00720.69
8.4.80.0130.00620.59
8.4.70.0120.00818.86
8.4.60.0100.01118.77
8.4.50.0110.01018.54
8.4.40.0130.00717.75
8.4.30.0130.00720.65
8.4.20.0130.00921.34
8.4.10.0040.00719.59
8.3.320.0110.01118.45
8.3.310.0140.00618.47
8.3.300.0120.00818.51
8.3.290.0140.00620.62
8.3.280.0110.00818.35
8.3.270.0110.00916.86
8.3.260.0110.00816.54
8.3.250.0110.00816.70
8.3.240.0120.00716.59
8.3.230.0080.00216.46
8.3.220.0060.00318.86
8.3.210.0030.00420.65
8.3.200.0050.00416.67
8.3.190.0130.00617.10
8.3.180.0050.00318.77
8.3.170.0030.01522.55
8.3.160.0070.01117.19
8.3.150.0080.00017.29
8.3.140.0080.00618.09
8.3.130.0080.00018.53
8.3.120.0000.00820.92
8.3.110.0080.00018.28
8.3.100.0400.00737.54
8.3.90.0360.01337.54
8.3.80.0340.01237.54
8.3.70.0310.00537.54
8.3.60.0340.01137.54
8.3.50.0320.00337.54
8.3.40.0160.00437.54
8.3.30.0200.00237.54
8.3.20.0260.01237.54
8.3.10.0330.00737.54
8.3.00.0340.01237.54
8.2.320.0140.00618.07
8.2.310.0130.00617.98
8.2.300.0130.00722.36
8.2.290.0120.00716.44
8.2.280.0110.00718.48
8.2.270.0030.02018.19
8.2.260.0090.00918.11
8.2.250.0040.00416.98
8.2.240.0060.00918.95
8.2.230.0120.00320.94
8.2.220.0250.01137.54
8.2.210.0240.00637.54
8.2.200.0210.00837.54
8.2.190.0250.00537.54
8.2.180.0240.00537.54
8.2.170.0300.00837.54
8.2.160.0230.00937.54
8.2.150.0400.00537.54
8.2.140.0380.00537.54
8.2.130.0330.00937.54
8.2.120.0370.00637.54
8.2.110.0360.01337.54
8.2.100.0340.00937.54
8.2.90.0380.00537.54
8.2.80.0380.00337.54
8.2.70.0320.00737.54
8.2.60.0330.00937.54
8.2.50.0310.00737.54
8.2.40.0250.01237.54
8.2.30.0350.00537.54
8.2.20.0370.00937.54
8.2.10.0320.00937.54
8.2.00.0240.00437.54
8.1.340.0140.00523.63
8.1.330.0090.00916.20
8.1.320.0110.01017.60
8.1.310.0150.00417.85
8.1.300.0040.00416.14
8.1.290.0270.00537.54
8.1.280.0260.00537.54
8.1.270.0210.00737.54
8.1.260.0260.00837.54
8.1.250.0320.00137.54
8.1.240.0130.01137.54
8.1.230.0200.00937.54
8.1.220.0210.00837.54
8.1.210.0270.00537.54
8.1.200.0260.00537.54
8.1.190.0180.00937.54
8.1.180.0240.00537.54
8.1.170.0300.00237.54
8.1.160.0270.00637.54
8.1.150.0220.00637.54
8.1.140.0240.00737.54
8.1.130.0240.00737.54
8.1.120.0270.00437.54
8.1.110.0290.00237.54
8.1.100.0260.00337.54
8.1.90.0240.00637.54
8.1.80.0220.01037.54
8.1.70.0280.00337.54
8.1.60.0270.00637.54
8.1.50.0240.01037.54
8.1.40.0280.01237.54
8.1.30.0330.00637.54
8.1.20.0240.00837.54
8.1.10.0140.00737.54
8.1.00.0180.00337.54

preferences:
51.45 ms | 1024 KiB | 5 Q