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) { $prev = null; if (is_callable($it)) { $prev = $it($prev); } else if (is_object($it)) { $prev = $it; } else { $prev = new $it($prev); } } return $prev; } 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 = iterator_chunk( new ArrayIterator(range(0, 125)) , 32); foreach ($it 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.0110.00316.63
8.3.50.0110.00818.12
8.3.40.0120.00618.63
8.3.30.0030.01218.84
8.3.20.0030.00618.85
8.3.10.0060.00318.86
8.3.00.0090.00019.38
8.2.180.0140.00016.38
8.2.170.0130.00722.96
8.2.160.0130.00320.64
8.2.150.0040.00424.18
8.2.140.0070.00424.66
8.2.130.0080.00026.16
8.2.120.0080.00021.07
8.2.110.0000.01020.58
8.2.100.0080.00417.91
8.2.90.0000.00819.34
8.2.80.0060.00319.38
8.2.70.0030.00917.72
8.2.60.0050.00317.93
8.2.50.0060.00318.07
8.2.40.0050.00320.00
8.2.30.0080.00018.20
8.2.20.0040.00417.77
8.2.10.0050.00217.89
8.2.00.0040.00417.68
8.1.280.0140.00725.92
8.1.270.0080.00023.99
8.1.260.0030.00526.35
8.1.250.0060.00328.09
8.1.240.0000.01121.93
8.1.230.0070.00422.60
8.1.220.0080.00018.77
8.1.210.0000.00819.15
8.1.200.0040.00817.35
8.1.190.0060.00317.66
8.1.180.0030.00618.10
8.1.170.0080.00018.95
8.1.160.0000.00718.92
8.1.150.0000.00818.61
8.1.140.0030.00517.48
8.1.130.0030.00317.77
8.1.120.0040.00417.41
8.1.110.0060.00317.34
8.1.100.0040.00417.39
8.1.90.0050.00217.46
8.1.80.0050.00317.47
8.1.70.0070.00017.46
8.1.60.0000.00917.57
8.1.50.0040.00417.50
8.1.40.0000.00817.51
8.1.30.0000.00817.57
8.1.20.0030.00617.64
8.1.10.0070.00317.64
8.1.00.0040.00417.45
8.0.300.0050.00319.94
8.0.290.0040.00416.88
8.0.280.0040.00418.45
8.0.270.0030.00317.24
8.0.260.0030.00316.92
8.0.250.0080.00017.04
8.0.240.0000.00716.96
8.0.230.0030.00317.11
8.0.220.0000.00717.00
8.0.210.0030.00317.03
8.0.200.0030.00317.07
8.0.190.0000.00817.06
8.0.180.0050.00317.06
8.0.170.0110.00016.89
8.0.160.0000.00816.96
8.0.150.0040.00416.82
8.0.140.0040.00716.96
8.0.130.0030.00313.46
8.0.120.0060.00316.96
8.0.110.0040.00316.87
8.0.100.0050.00216.93
8.0.90.0070.00016.99
8.0.80.0030.01317.02
8.0.70.0070.00017.03
8.0.60.0050.00317.04
8.0.50.0040.00417.02
8.0.30.0130.00317.14
8.0.20.0160.00717.25
8.0.10.0070.00016.98
8.0.00.0120.00816.75
7.4.330.0050.00012.96
7.4.320.0000.00716.54
7.4.300.0000.00616.55
7.4.290.0030.00316.68
7.4.280.0060.00316.50
7.4.270.0040.00416.56
7.4.260.0030.00313.34
7.4.250.0040.00416.63
7.4.240.0030.00316.59
7.4.230.0070.00016.73
7.4.220.0100.00616.63
7.4.210.0110.01016.52
7.4.200.0050.00316.66
7.4.190.0000.00716.51
7.4.160.0080.00816.67
7.4.150.0190.00316.71
7.4.140.0100.00716.56
7.4.130.0140.00416.60
7.4.120.0040.01516.44
7.4.110.0060.01516.67
7.4.100.0060.01216.62
7.4.90.0130.00716.57
7.4.80.0050.01619.39
7.4.70.0030.01416.49
7.4.60.0120.00416.64
7.4.50.0030.00616.54
7.4.40.0060.00616.59
7.4.30.0170.00016.30
7.4.00.0060.00915.02
7.3.330.0060.00013.43
7.3.320.0000.00613.31
7.3.310.0050.00316.29
7.3.300.0000.00716.47
7.3.290.0080.00616.44
7.3.280.0120.00716.50
7.3.270.0070.01016.44
7.3.260.0070.01116.40
7.3.250.0100.01016.36
7.3.240.0030.01316.39
7.3.230.0100.00616.59
7.3.210.0090.00916.68
7.3.200.0030.01916.52
7.3.190.0180.00816.57
7.3.180.0070.01016.54
7.3.170.0040.01516.38
7.3.160.0100.00716.55
7.3.120.0070.01014.98
7.2.330.0120.01216.78
7.2.320.0160.00716.73
7.2.310.0070.01116.75
7.2.300.0130.01016.78
7.2.290.0140.00316.76
7.2.60.0130.00316.74
7.2.00.0040.01219.29
7.1.200.0070.00715.81
7.1.100.0000.01418.31
7.1.70.0040.00417.18
7.1.60.0140.01119.30
7.1.50.0030.01717.07
7.1.00.0030.03322.37
7.0.200.0040.00416.86
7.0.140.0000.07322.02
7.0.120.0030.07022.05
7.0.60.0100.03720.03
7.0.50.0100.05317.89
7.0.40.0070.04320.40
7.0.30.0230.04320.12
7.0.20.0130.09020.19
7.0.10.0070.04020.16
7.0.00.0100.05020.20
5.6.280.0030.07321.13
5.6.210.0100.06020.68
5.6.200.0070.06718.18
5.6.190.0000.07720.48
5.6.180.0500.05320.52
5.6.170.0070.05020.48
5.6.160.0130.04320.46
5.6.150.0030.04018.14
5.6.140.0100.06018.12
5.6.130.0030.04318.26
5.6.120.0100.08021.18
5.6.110.0100.07320.90
5.6.100.0030.08321.07
5.6.90.0170.07321.04
5.6.80.0100.08020.45
5.5.350.0030.05020.41
5.5.340.0030.05017.98
5.5.330.0030.09020.26
5.5.320.0330.07020.35
5.5.310.0400.06320.32
5.5.300.0030.04018.00
5.5.290.0000.07318.06
5.5.280.0030.04020.68
5.5.270.0100.08020.75
5.5.260.0170.07320.76
5.5.250.0030.04020.71
5.5.240.0070.09020.32
5.4.450.0200.04719.57
5.4.440.0100.04719.64
5.4.430.0230.07019.46
5.4.420.0170.04719.32
5.4.410.0130.04019.39
5.4.400.0200.04319.07
5.4.390.0230.02719.25
5.4.380.0100.05019.32
5.4.370.0200.03719.06
5.4.360.0170.04019.16
5.4.350.0200.03319.20
5.4.340.0070.06019.08
5.4.320.0170.04019.16
5.4.310.0130.06318.97
5.4.300.0200.03319.24
5.4.290.0270.06319.21
5.4.280.0330.02319.31
5.4.270.0130.03719.16
5.4.260.0000.04018.87
5.4.250.0100.03019.19
5.4.240.1000.04019.17
5.4.230.1630.03319.06
5.4.220.1630.03719.06
5.4.210.0270.03718.86
5.4.200.0170.03718.87
5.4.190.0230.03018.98
5.4.180.0230.03019.21
5.4.170.0170.03718.94
5.4.160.0200.03019.20
5.4.150.0200.03019.20
5.4.140.0130.03716.43
5.4.130.0170.03316.33
5.4.120.0170.03316.41
5.4.110.0100.04016.59
5.4.100.0170.03316.30
5.4.90.0230.04316.59
5.4.80.0130.03716.28
5.4.70.0170.04716.22
5.4.60.0230.03716.43
5.4.50.0030.05016.55
5.4.40.0200.04016.14
5.4.30.0130.04016.16
5.4.20.0200.03316.33
5.4.10.0230.03016.16
5.4.00.0270.02715.84
5.3.290.0230.03314.82
5.3.280.0130.04714.67
5.3.270.0230.03314.61
5.3.260.0200.03314.66
5.3.250.0130.04314.83
5.3.240.0170.03714.58
5.3.230.0170.04014.50
5.3.220.0230.03314.59
5.3.210.0170.04014.80
5.3.200.0130.04014.59
5.3.190.0230.03314.66
5.3.180.0170.03714.64
5.3.170.0200.03714.54
5.3.160.0200.04014.49
5.3.150.0230.03314.62
5.3.140.0130.04714.56
5.3.130.0230.04314.52
5.3.120.0170.03714.55
5.3.110.0300.03714.46
5.3.100.0200.06314.03
5.3.90.0100.04313.93
5.3.80.0170.03714.07
5.3.70.0230.03014.03
5.3.60.0170.03713.92
5.3.50.0230.03013.96
5.3.40.0200.04314.04
5.3.30.0200.03713.89
5.3.20.0100.03713.70
5.3.10.0130.04013.59
5.3.00.0270.03713.55
5.2.170.0170.03711.08
5.2.160.0200.02311.16
5.2.150.0000.03011.24
5.2.140.0130.02711.06
5.2.130.0000.03011.02
5.2.120.1070.03311.16
5.2.110.0000.03011.02
5.2.100.0030.02711.02
5.2.90.0030.03311.03
5.2.80.0030.03711.21
5.2.70.1070.03011.10
5.2.60.1630.04011.12
5.2.50.1330.02711.25
5.2.40.1330.04310.93
5.2.30.1070.03011.19
5.2.20.1330.03010.97
5.2.10.1070.03310.79
5.2.00.1130.02310.68
5.1.60.1130.01710.09
5.1.50.0130.02710.13
5.1.40.0070.0279.96
5.1.30.0070.02310.25
5.1.20.0000.03310.33
5.1.10.0900.02310.01
5.1.00.1070.02310.09
5.0.50.0700.0378.46
5.0.40.0600.0178.56
5.0.30.0570.0308.22
5.0.20.0700.0208.19
5.0.10.0600.0238.07
5.0.00.0700.0338.10
4.4.90.0600.0137.49
4.4.80.0630.0177.49
4.4.70.0030.0177.49
4.4.60.0030.0137.49
4.4.50.0030.0137.49
4.4.40.0000.0237.49
4.4.30.0070.0107.49
4.4.20.0000.0177.49
4.4.10.0130.0137.49
4.4.00.0770.0237.49
4.3.110.0630.0207.49
4.3.100.0530.0137.49
4.3.90.0770.0107.49
4.3.80.0600.0307.49
4.3.70.0530.0177.49
4.3.60.0030.0307.49
4.3.50.0070.0137.49
4.3.40.0000.0477.49
4.3.30.0000.0207.49
4.3.20.0030.0137.49
4.3.10.0130.0177.49
4.3.00.0300.0137.49

preferences:
40.17 ms | 401 KiB | 5 Q