3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! function iterator_compose() { foreach (array_reverse(func_get_args()) as $it) { if (is_callable($it)) { $prev = $it; } } } function iterator_chunk(\Traversable $it, $chunkSize) { $it = new \IteratorIterator($it); $chunk = []; $steps = range(0, $chunkSize); while (true) { foreach ($steps as $_) { if (!$it->valid()) { break 1; } $chunk[] = $it->current(); $it->next(); } yield $chunk; $chunk = []; } if ($chunk) { yield $chunk; } } $it = new ArrayIterator(range(0, 125)); foreach (iterator_chunk($it, 32) as $i => $c) { echo "====== Chunk $i ======\n"; var_export($c); echo "\n"; }

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.0330.00918.18
8.3.50.0480.01322.05
8.3.40.0220.02218.79
8.3.30.0360.00819.09
8.3.20.0310.00720.06
8.3.10.0140.01423.61
8.3.00.0100.00020.64
8.2.180.0460.01016.63
8.2.170.0450.00822.96
8.2.160.0560.02122.21
8.2.150.0150.01024.18
8.2.140.0060.00624.66
8.2.130.0300.02026.16
8.2.120.0310.00420.88
8.2.110.0080.00422.08
8.2.100.0120.00317.84
8.2.90.0030.00619.05
8.2.80.0100.00618.03
8.2.70.0000.01017.50
8.2.60.0100.00017.93
8.2.50.0040.00718.07
8.2.40.0150.00017.91
8.2.30.0080.00418.07
8.2.20.0140.00517.75
8.2.10.0090.00919.52
8.2.00.0090.00917.77
8.1.280.0090.00925.92
8.1.270.0270.00023.64
8.1.260.0250.00426.35
8.1.250.0380.00428.09
8.1.240.0120.01823.90
8.1.230.0250.00319.09
8.1.220.0040.01117.74
8.1.210.0140.00318.77
8.1.200.0110.00017.48
8.1.190.0070.00317.43
8.1.180.0060.01218.10
8.1.170.0100.00718.60
8.1.160.0090.00922.10
8.1.150.0060.00318.68
8.1.140.0000.01617.42
8.1.130.0000.01617.79
8.1.120.0100.00517.58
8.1.110.0100.00717.42
8.1.100.0110.00417.60
8.1.90.0160.00017.61
8.1.80.0090.00017.58
8.1.70.0000.01617.45
8.1.60.0000.00917.63
8.1.50.0120.00617.52
8.1.40.0080.00817.64
8.1.30.0110.00617.55
8.1.20.0050.01117.63
8.1.10.0130.00517.55
8.1.00.0190.00017.58
8.0.300.0110.00618.77
8.0.290.0100.00717.05
8.0.280.0140.00018.32
8.0.270.0140.00317.21
8.0.260.0110.00516.77
8.0.250.0040.00416.91
8.0.240.0130.00416.96
8.0.230.0110.00516.86
8.0.220.0000.01816.95
8.0.210.0160.00416.83
8.0.200.0110.00716.94
8.0.190.0130.00716.98
8.0.180.0100.01016.84
8.0.170.0170.00616.84
8.0.160.0090.00916.94
8.0.150.0040.00416.93
8.0.140.0030.00516.84
8.0.130.0110.00613.39
8.0.120.0130.00616.76
8.0.110.0080.00416.79
8.0.100.0030.00616.93
8.0.90.0000.01516.85
8.0.80.0260.02716.87
8.0.70.0080.00816.72
8.0.60.0050.01016.71
8.0.50.0060.00316.89
8.0.30.0320.02616.94
8.0.20.0400.01717.40
8.0.10.0080.00017.05
8.0.00.0400.01716.59
7.4.330.0050.01015.21
7.4.320.0000.00816.47
7.4.300.0040.00416.41
7.4.290.0050.01216.48
7.4.280.0120.00616.42
7.4.270.0130.00616.52
7.4.260.0000.01716.54
7.4.250.0170.00016.52
7.4.240.0080.01016.48
7.4.230.0170.00016.44
7.4.220.0700.08616.35
7.4.210.0330.01716.48
7.4.200.0110.00416.61
7.4.190.0120.00416.48
7.4.160.0350.03516.47
7.4.150.0680.02017.40
7.4.140.0370.02417.86
7.4.130.0380.02716.51
7.4.120.0410.01716.51
7.4.110.0460.01816.52
7.4.100.0410.02616.59
7.4.90.0510.02516.34
7.4.80.1410.04016.41
7.4.70.0460.01816.46
7.4.60.0380.01316.58
7.4.50.0060.00316.48
7.4.40.0130.01022.77
7.4.30.0520.02416.54
7.4.00.0110.01415.08
7.3.330.0040.00413.53
7.3.320.0120.00613.52
7.3.310.0080.00816.34
7.3.300.0080.00016.19
7.3.290.0200.02816.37
7.3.280.0240.02616.34
7.3.270.0670.02517.40
7.3.260.0550.01016.41
7.3.250.0550.02316.42
7.3.240.0370.01216.33
7.3.230.1480.03516.39
7.3.210.0980.04016.34
7.3.200.0400.03219.39
7.3.190.0200.02316.33
7.3.180.0430.01616.48
7.3.170.0780.03516.43
7.3.160.0140.03316.32
7.3.120.0060.01514.99
7.2.330.0570.02616.88
7.2.320.0950.02316.84
7.2.310.0240.02616.68
7.2.300.0160.01916.36
7.2.290.0360.02516.74
7.1.200.0140.00815.88
7.1.70.0000.01117.12
7.1.60.0040.01819.32
7.1.50.0130.02017.18
7.0.200.0040.01216.73

preferences:
45.47 ms | 401 KiB | 5 Q