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->rewind(); $chunk = []; $steps = range(0, $chunkSize); while (true) { foreach ($steps as $_) { if (!$it->valid()) { break 2; } $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.0060.01016.85
8.3.50.0140.00917.44
8.3.40.0150.00018.91
8.3.30.0170.00318.88
8.3.20.0040.00418.89
8.3.10.0030.00520.66
8.3.00.0080.00017.71
8.2.180.0070.00718.30
8.2.170.0100.00722.96
8.2.160.0030.01022.13
8.2.150.0030.00624.18
8.2.140.0030.00524.66
8.2.130.0050.00326.16
8.2.120.0060.00319.77
8.2.110.0000.01022.08
8.2.100.0060.00617.91
8.2.90.0040.00418.09
8.2.80.0030.00617.97
8.2.70.0090.00917.38
8.2.60.0050.00318.04
8.2.50.0040.00418.07
8.2.40.0070.00018.22
8.2.30.0040.00418.06
8.2.20.0080.00017.88
8.2.10.0050.00317.79
8.2.00.0050.00317.85
8.1.280.0060.00925.92
8.1.270.0000.00823.99
8.1.260.0080.00626.35
8.1.250.0040.00428.09
8.1.240.0060.00321.98
8.1.230.0040.00821.04
8.1.220.0040.00417.76
8.1.210.0000.00818.95
8.1.200.0000.01217.22
8.1.190.0040.00417.66
8.1.180.0030.00718.10
8.1.170.0030.00518.81
8.1.160.0000.00718.91
8.1.150.0040.00418.75
8.1.140.0040.00417.54
8.1.130.0070.00017.80
8.1.120.0040.00417.50
8.1.110.0060.00317.50
8.1.100.0000.00717.45
8.1.90.0000.00717.50
8.1.80.0080.00017.59
8.1.70.0000.00717.52
8.1.60.0000.00917.62
8.1.50.0020.00517.56
8.1.40.0030.00517.56
8.1.30.0000.00717.70
8.1.20.0030.00517.65
8.1.10.0040.00417.50
8.1.00.0040.00417.59
8.0.300.0060.00320.02
8.0.290.0000.00716.88
8.0.280.0040.00418.49
8.0.270.0050.00317.22
8.0.260.0030.00316.91
8.0.250.0070.00017.05
8.0.240.0030.00917.06
8.0.230.0030.00317.07
8.0.220.0070.00017.05
8.0.210.0070.00016.97
8.0.200.0030.00316.99
8.0.190.0040.00417.02
8.0.180.0070.00016.92
8.0.170.0030.00717.02
8.0.160.0000.00817.00
8.0.150.0040.00416.98
8.0.140.0040.00417.00
8.0.130.0000.00613.42
8.0.120.0040.00416.85
8.0.110.0000.00817.02
8.0.100.0000.00716.91
8.0.90.0050.00216.95
8.0.80.0070.00716.88
8.0.70.0020.00517.01
8.0.60.0030.00516.96
8.0.50.0020.00517.01
8.0.30.0140.00617.24
8.0.20.0120.00717.18
8.0.10.0000.00717.03
8.0.00.0090.01216.83
7.4.330.0050.00014.82
7.4.320.0030.00316.48
7.4.300.0000.00616.46
7.4.290.0040.00416.64
7.4.280.0000.00916.52
7.4.270.0070.00016.52
7.4.260.0030.00313.30
7.4.250.0040.00416.61
7.4.240.0040.00416.57
7.4.230.0000.00716.47
7.4.220.0160.00516.45
7.4.210.0110.00816.64
7.4.200.0030.00316.42
7.4.190.0000.00716.50
7.4.160.0040.01316.52
7.4.150.0080.01217.07
7.4.140.0130.00417.13
7.4.130.0120.00516.49
7.4.120.0080.00916.62
7.4.110.0090.00916.71
7.4.100.0060.01216.52
7.4.90.0130.01016.61
7.4.80.0060.01218.80
7.4.70.0070.01116.50
7.4.60.0030.01616.62
7.4.50.0040.00416.44
7.4.40.0050.00922.27
7.4.30.0090.01316.43
7.4.00.0090.00615.18
7.3.330.0080.00013.39
7.3.320.0050.00013.28
7.3.310.0000.00716.36
7.3.300.0030.00316.33
7.3.290.0040.01116.37
7.3.280.0070.01216.45
7.3.270.0070.01017.07
7.3.260.0090.00918.24
7.3.250.0100.01016.69
7.3.240.0040.01316.56
7.3.230.0110.00516.65
7.3.210.0090.00916.55
7.3.200.0100.00719.39
7.3.190.0110.00616.57
7.3.180.0100.01016.46
7.3.170.0090.00616.57
7.3.160.0060.00916.58
7.3.120.0040.01414.68
7.2.330.0030.01516.47
7.2.320.0030.01416.80
7.2.310.0110.01516.82
7.2.300.0110.00616.57
7.2.290.0060.01216.84
7.2.00.0060.00619.44
7.1.100.0080.00618.05
7.1.70.0030.01317.07
7.1.60.0090.01619.40
7.1.50.0070.01416.99
7.1.00.0000.08022.37
7.0.200.0030.00616.80
7.0.140.0070.06322.18
7.0.60.0100.08319.83
7.0.50.0130.06017.83
7.0.40.0070.06320.20
7.0.30.0270.07720.23
7.0.20.0300.07020.15
7.0.10.0470.04020.30
7.0.00.0100.05720.24
5.6.210.0130.03320.59
5.6.200.0030.04318.15
5.6.190.0170.05720.33
5.6.180.0270.04320.64
5.6.170.0200.05020.51
5.6.160.0000.07320.50
5.6.150.0100.04018.14
5.6.140.0130.07718.28
5.6.130.0070.08018.15
5.6.120.0100.06721.18
5.6.110.0130.06321.09
5.6.100.0100.08321.02
5.6.90.0070.08721.14
5.6.80.0030.03720.48
5.6.70.4200.04720.52
5.5.350.0400.06020.48
5.5.340.0030.08017.94
5.5.330.0070.08720.40
5.5.320.0130.04720.13
5.5.310.0200.04720.30
5.5.300.0030.04017.96
5.5.290.0130.07718.07
5.5.280.0130.06720.92
5.5.270.0130.07720.80
5.5.260.0000.06320.90
5.5.250.0100.03320.62
5.5.240.0100.08020.08
5.4.450.0100.03719.14
5.4.440.0030.04019.57
5.4.430.0030.04319.47
5.4.420.0030.04019.20
5.4.410.0070.03319.35
5.4.400.0070.03319.13
5.4.390.0070.03319.24
5.4.380.0100.03019.01
5.4.370.0070.04318.87
5.4.360.0030.04019.12
5.4.350.0330.03319.11
5.4.340.0100.05719.14
5.4.320.0170.07318.85
5.4.310.0100.04018.97
5.4.300.0170.03319.14
5.4.290.0070.04019.08
5.4.280.0130.06019.14
5.4.270.0070.04019.12
5.4.260.0000.04318.87
5.4.250.0030.06018.85
5.4.240.0030.04019.00
5.4.230.0130.03019.14
5.4.220.0100.07018.92
5.4.210.0070.07019.20
5.4.200.0070.03719.11
5.4.190.0030.05719.20
5.4.180.0100.03718.86
5.4.170.0100.07319.15
5.4.160.0070.07319.00
5.4.150.0070.07319.06
5.4.140.0100.06316.39
5.4.130.0000.04316.46
5.4.120.0130.07016.55
5.4.110.0030.03716.46
5.4.100.0030.03716.48
5.4.90.0030.03716.44
5.4.80.0000.05016.46
5.4.70.0100.06016.38
5.4.60.0030.04016.37
5.4.50.0000.04016.27
5.4.40.0000.03716.40
5.4.30.0130.06016.38
5.4.20.0070.07016.38
5.4.10.0030.04016.50
5.4.00.0100.05015.95
5.3.290.0030.06714.66
5.3.280.0100.04014.48
5.3.270.0070.07314.77
5.3.260.0070.06014.62
5.3.250.0000.04314.64
5.3.240.0100.03714.62
5.3.230.0070.05014.63
5.3.220.0100.03714.58
5.3.210.0070.03714.57
5.3.200.0070.06714.60
5.3.190.0070.03714.63
5.3.180.0030.03714.72
5.3.170.0070.07314.61
5.3.160.0100.03014.59
5.3.150.0100.07314.63
5.3.140.0000.04014.48
5.3.130.0130.04714.55
5.3.120.0030.04714.63
5.3.110.0100.04714.61
5.3.100.0070.07014.04
5.3.90.0030.03713.92
5.3.80.0070.06314.07
5.3.70.0070.04714.08
5.3.60.0070.07314.01
5.3.50.0000.04013.95
5.3.40.0030.03713.95
5.3.30.0030.06013.88
5.3.20.0030.04313.72
5.3.10.0000.04313.68
5.3.00.0000.08313.64
5.2.170.0000.03311.29
5.2.160.0000.04311.14
5.2.150.0070.04011.20
5.2.140.0070.04311.16
5.2.130.0030.05011.15
5.2.120.0030.03311.27
5.2.110.0070.06011.24
5.2.100.0070.03311.18
5.2.90.0000.04011.05
5.2.80.0030.03310.98
5.2.70.0030.03310.98
5.2.60.0070.05011.10
5.2.50.0070.03710.96
5.2.40.0070.02710.88
5.2.30.0000.03011.11
5.2.20.0070.06311.12
5.2.10.0030.03010.92
5.2.00.0030.02710.73
5.1.60.0000.0309.96
5.1.50.0100.05010.00
5.1.40.0030.0239.88
5.1.30.0070.02710.43
5.1.20.0070.05010.35
5.1.10.0000.02710.12
5.1.00.0030.0279.98
5.0.50.0030.0278.52
5.0.40.0030.0178.32
5.0.30.0030.0378.20
5.0.20.0030.0208.22
5.0.10.0000.0278.08
5.0.00.0000.0378.14
4.4.90.0000.0407.68
4.4.80.0000.0177.68
4.4.70.0030.0207.68
4.4.60.0000.0437.68
4.4.50.0000.0307.68
4.4.40.0000.0477.68
4.4.30.0070.0107.68
4.4.20.0000.0177.68
4.4.10.0070.0137.68
4.4.00.0030.0237.68
4.3.110.0000.0177.68
4.3.100.0000.0307.68
4.3.90.0000.0177.68
4.3.80.0000.0237.68
4.3.70.0030.0137.68
4.3.60.0030.0137.68
4.3.50.0000.0177.68
4.3.40.0070.0207.68
4.3.30.0000.0177.68
4.3.20.0030.0337.68
4.3.10.0000.0207.68
4.3.00.0000.0177.68

preferences:
45.43 ms | 401 KiB | 5 Q