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 $_) { $chunk[] = $it->current(); $it->next(); if (!$it->valid()) { break 1; } } 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.0170.00816.63
8.3.50.0180.00817.38
8.3.40.0190.00618.57
8.3.30.0130.01019.02
8.3.20.0190.00018.73
8.3.10.0110.00418.73
8.3.00.0070.00319.38
8.2.180.0160.00616.32
8.2.170.0090.00922.96
8.2.160.0380.00621.14
8.2.150.0280.00524.18
8.2.140.0290.00024.66
8.2.130.0070.00326.16
8.2.120.0070.00418.87
8.2.110.0070.00421.12
8.2.100.0120.00317.84
8.2.90.0140.00319.35
8.2.80.0030.00719.38
8.2.70.0060.00317.63
8.2.60.0030.00717.93
8.2.50.0080.00818.07
8.2.40.0060.00318.28
8.2.30.0060.00918.08
8.2.20.0050.01117.79
8.2.10.0030.00817.87
8.2.00.0060.00317.79
8.1.280.0120.00925.92
8.1.270.0080.00424.66
8.1.260.0140.01026.35
8.1.250.0220.00428.09
8.1.240.0150.00923.79
8.1.230.0070.00721.04
8.1.220.0170.00017.74
8.1.210.0130.00618.87
8.1.200.0070.01117.35
8.1.190.0060.00617.66
8.1.180.0060.00318.10
8.1.170.0030.00618.89
8.1.160.0170.00019.05
8.1.150.0080.00818.75
8.1.140.0090.00917.59
8.1.130.0070.00717.79
8.1.120.0040.00417.44
8.1.110.0060.00317.58
8.1.100.0030.00617.52
8.1.90.0070.00317.56
8.1.80.0030.00617.49
8.1.70.0040.00717.54
8.1.60.0060.00617.60
8.1.50.0030.00717.43
8.1.40.0130.00417.63
8.1.30.0090.00517.70
8.1.20.0090.00317.70
8.1.10.0050.00517.70
8.1.00.0040.00417.66
8.0.300.0040.00419.83
8.0.290.0050.00516.63
8.0.280.0040.00418.34
8.0.270.0090.00617.14
8.0.260.0000.00816.73
8.0.250.0030.00717.02
8.0.240.0030.00716.90
8.0.230.0050.00317.05
8.0.220.0130.00316.88
8.0.210.0150.00016.91
8.0.200.0120.00616.88
8.0.190.0090.01016.88
8.0.180.0100.00016.91
8.0.170.0030.01016.92
8.0.160.0000.00816.94
8.0.150.0130.00816.88
8.0.140.0070.00716.88
8.0.130.0000.01013.41
8.0.120.0030.00616.82
8.0.110.0060.00316.77
8.0.100.0050.00516.90
8.0.90.0000.01616.98
8.0.80.0190.01416.86
8.0.70.0050.00616.82
8.0.60.0030.00616.88
8.0.50.0050.00316.93
8.0.30.0250.01216.98
8.0.20.0520.01716.99
8.0.10.0000.00817.01
8.0.00.0370.01616.62
7.4.330.0070.00013.05
7.4.320.0100.00516.58
7.4.300.0070.00216.43
7.4.290.0050.00516.43
7.4.280.0080.01316.34
7.4.270.0110.00516.44
7.4.260.0060.00313.42
7.4.250.0000.01016.47
7.4.240.0140.00016.47
7.4.230.0030.00616.53
7.4.220.0400.02616.37
7.4.210.0120.02316.49
7.4.200.0070.00716.39
7.4.190.0090.00016.38
7.4.160.0250.02216.59
7.4.150.0190.03216.35
7.4.140.0330.02216.53
7.4.130.0320.02016.55
7.4.120.0370.01416.47
7.4.110.0930.04716.42
7.4.100.0360.00916.45
7.4.90.0470.01416.40
7.4.80.0440.00819.39
7.4.70.0620.02616.32
7.4.60.0460.02216.39
7.4.50.0560.00516.34
7.4.40.0040.01816.37
7.4.30.0150.02716.29
7.3.330.0120.00613.43
7.3.320.0000.01513.47
7.3.310.0040.00416.34
7.3.300.0120.00416.34
7.3.290.0140.02416.27
7.3.280.0280.01716.32
7.3.270.0430.01716.31
7.3.260.0380.02216.25
7.3.250.0450.02016.30
7.3.240.0420.03116.24
7.3.230.0180.00916.41
7.3.210.1070.03216.44
7.3.200.0520.03316.47
7.3.190.0220.03116.36
7.3.180.0420.06616.27
7.3.170.0550.00616.36
7.3.160.0270.02216.49
7.2.330.0190.01316.50
7.2.320.0440.01716.61
7.2.310.0600.03216.69
7.2.300.1120.01816.57
7.2.290.0170.00716.62
7.1.70.0020.00717.04
7.1.60.0100.00717.41
7.1.50.0070.00416.99
7.1.40.0040.01916.64
7.1.30.0110.00416.75
7.1.20.0100.00316.90
7.1.10.0050.00516.49
7.1.00.0050.00516.64
7.0.200.0050.00516.87
7.0.190.0000.00816.90
7.0.180.0000.01116.30
7.0.170.0050.00316.38
7.0.160.0000.01116.25
7.0.150.0030.00516.40
7.0.140.0050.00516.45
7.0.130.0060.00616.91
7.0.120.0040.00716.91
7.0.110.0070.00316.91
7.0.100.0000.00816.91
7.0.90.0040.00416.91
7.0.80.0000.00816.91
7.0.70.0030.00816.91
7.0.60.0030.00716.91
7.0.50.0000.01116.91
7.0.40.0030.00616.91
7.0.30.0000.00816.91
7.0.20.0030.00616.91
7.0.10.0070.00716.91
7.0.00.0090.00316.91
5.6.300.0060.03820.95
5.6.290.0100.07420.88
5.6.280.0100.05221.16
5.6.270.0030.06620.92
5.6.260.0100.03921.13
5.6.250.0100.04020.94
5.6.240.0030.04321.01
5.6.230.0100.04220.90
5.6.220.0030.04520.90
5.6.210.0100.03721.09
5.6.200.0070.04020.89
5.6.190.0100.04420.93
5.6.180.0000.05720.89
5.6.170.0070.05221.08
5.6.160.0100.07420.88
5.6.150.0000.06820.98
5.6.140.0130.07120.88
5.6.130.0040.05021.04
5.6.120.0070.05920.82
5.6.110.0070.08520.88
5.6.100.0070.09220.91
5.6.90.0070.07221.03
5.6.80.0060.08120.17
5.6.70.0030.04520.27
5.6.60.0070.08420.37
5.6.50.0090.03820.46
5.6.40.0030.06320.25
5.6.30.0030.04820.29
5.6.20.0070.07720.34
5.6.10.0070.08320.24
5.6.00.0030.05120.23
5.5.380.0030.05417.48
5.5.370.0100.04017.59
5.5.360.0100.03817.40
5.5.350.0030.04417.58
5.5.340.0030.04118.02
5.5.330.0070.04918.10
5.5.320.0000.04618.16
5.5.310.0070.04018.13
5.5.300.0090.07817.87
5.5.290.0030.04318.09
5.5.280.0030.08818.11
5.5.270.0100.09117.70
5.5.260.0190.07418.06
5.5.250.0070.08617.90
5.5.240.0140.04517.46
5.5.230.0070.03917.36
5.5.220.0030.04117.41
5.5.210.0030.04117.50
5.5.200.0000.04517.23
5.5.190.0100.07417.48
5.5.180.0090.03417.07
5.5.160.0070.06917.21
5.5.150.0140.05817.43
5.5.140.0100.03317.22
5.5.130.0100.07117.41
5.5.120.0000.04417.43
5.5.110.0100.03817.21
5.5.100.0070.03716.96
5.5.90.0070.04017.31
5.5.80.0040.04217.11
5.5.70.0030.04317.37
5.5.60.0000.08717.34
5.5.50.0030.04817.12
5.5.40.0100.03216.95
5.5.30.0030.03717.36
5.5.20.0030.04017.39
5.5.10.0000.04617.35
5.5.00.0030.04117.34
5.4.450.0030.04319.42
5.4.440.0100.07819.40
5.4.430.0030.07619.53
5.4.420.0160.07519.39
5.4.410.0100.07519.18
5.4.400.0030.03919.25
5.4.390.0030.03919.12
5.4.380.0000.04119.05
5.4.370.0030.07918.93
5.4.360.0030.05319.04
5.4.350.0030.04219.08
5.4.340.0160.07119.01
5.4.320.0030.08319.09
5.4.310.0030.03918.98
5.4.300.0030.06719.16
5.4.290.0000.07119.16
5.4.280.0100.04519.21
5.4.270.0000.05219.21
5.4.260.0060.04119.07
5.4.250.0110.03519.12
5.4.240.0100.03519.15
5.4.230.0030.03619.16
5.4.220.0000.06019.07
5.4.210.0000.04119.13
5.4.200.0000.04418.98
5.4.190.0100.04619.08
5.4.180.0100.03219.20
5.4.170.0070.06718.98
5.4.160.0000.04119.23
5.4.150.0100.07319.22
5.4.140.0060.03516.91
5.4.130.0070.03716.91
5.4.120.0000.04416.91
5.4.110.0000.04616.91
5.4.100.0070.03816.91
5.4.90.0030.07516.91
5.4.80.0030.05116.91
5.4.70.0000.07916.91
5.4.60.0000.05116.91
5.4.50.0060.03216.91
5.4.40.0100.03316.91
5.4.30.0000.05916.91
5.4.20.0130.07616.91
5.4.10.0000.03816.91
5.4.00.0000.07816.91
5.3.290.0030.05516.91
5.3.280.0040.04316.91
5.3.270.0030.07316.91
5.3.260.0030.06216.91
5.3.250.0000.05416.91
5.3.240.0030.04216.91
5.3.230.0030.03916.91
5.3.220.0030.03816.91
5.3.210.0040.04616.91
5.3.200.0030.06116.91
5.3.190.0030.03616.91
5.3.180.0070.03516.91
5.3.170.0000.08816.91
5.3.160.0170.03016.91
5.3.150.0070.03416.91
5.3.140.0040.03516.91
5.3.130.0030.05016.91
5.3.120.0000.04016.91
5.3.110.0070.03316.91
5.3.100.0030.06716.91
5.3.90.0030.07216.91
5.3.80.0030.07816.91
5.3.70.0030.07316.91
5.3.60.0030.06116.91
5.3.50.0070.04816.91
5.3.40.0130.06716.91
5.3.30.0030.08016.91
5.3.20.0030.03316.91
5.3.10.0030.07216.91
5.3.00.0030.07316.91

preferences:
42.65 ms | 401 KiB | 5 Q