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 2; } } 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.40.0120.00318.96
8.3.30.0200.00319.10
8.3.20.0070.00020.29
8.3.10.0080.00022.09
8.3.00.0030.00522.32
8.2.170.0110.00422.96
8.2.160.0070.00720.39
8.2.150.0000.00924.18
8.2.140.0040.00424.66
8.2.130.0110.00726.16
8.2.120.0000.00819.36
8.2.110.0100.00022.14
8.2.100.0080.00417.91
8.2.90.0060.00319.22
8.2.80.0030.00618.05
8.2.70.0050.00317.63
8.2.60.0000.00818.05
8.2.50.0050.00318.07
8.2.40.0060.00318.34
8.2.30.0060.00318.01
8.2.20.0000.00817.81
8.2.10.0040.00419.64
8.2.00.0040.00419.65
8.1.270.0030.00623.96
8.1.260.0030.00526.35
8.1.250.0050.00328.09
8.1.240.0060.00323.76
8.1.230.0080.00319.18
8.1.220.0080.00017.74
8.1.210.0050.00318.77
8.1.200.0060.00317.38
8.1.190.0000.00817.40
8.1.180.0050.00318.10
8.1.170.0030.00618.63
8.1.160.0050.00321.91
8.1.150.0000.00718.67
8.1.140.0090.00017.49
8.1.130.0000.00717.73
8.1.120.0000.00717.50
8.1.110.0050.00217.55
8.1.100.0040.00417.44
8.1.90.0040.00417.52
8.1.80.0070.00017.43
8.1.70.0000.00717.43
8.1.60.0040.00417.60
8.1.50.0040.00417.56
8.1.40.0000.00817.55
8.1.30.0080.00017.68
8.1.20.0050.00317.67
8.1.10.0040.00417.51
8.1.00.0000.00817.41
8.0.300.0040.00418.77
8.0.290.0040.00417.16
8.0.280.0030.00318.39
8.0.270.0050.00317.25
8.0.260.0040.00416.82
8.0.250.0000.00717.05
8.0.240.0040.00417.06
8.0.230.0040.00417.00
8.0.220.0030.00316.98
8.0.210.0000.00716.89
8.0.200.0000.00717.06
8.0.190.0040.00417.09
8.0.180.0070.00017.02
8.0.170.0000.00716.95
8.0.160.0050.00316.93
8.0.150.0040.00417.01
8.0.140.0040.00416.91
8.0.130.0000.00613.43
8.0.120.0070.00016.95
8.0.110.0000.00716.99
8.0.100.0040.00416.99
8.0.90.0000.00716.88
8.0.80.0060.01216.98
8.0.70.0040.00416.96
8.0.60.0040.00417.05
8.0.50.0000.00717.02
8.0.30.0150.00817.13
8.0.20.0100.01017.40
8.0.10.0040.00417.02
8.0.00.0110.00816.97
7.4.330.0000.00515.00
7.4.320.0030.00316.46
7.4.300.0000.00616.52
7.4.290.0000.00716.64
7.4.280.0030.00516.67
7.4.270.0000.00816.63
7.4.260.0000.00916.43
7.4.250.0080.00016.48
7.4.240.0040.00416.64
7.4.230.0040.00416.66
7.4.220.0120.01216.63
7.4.210.0080.00616.65
7.4.200.0000.00716.54
7.4.190.0030.00316.63
7.4.160.0080.00816.64
7.4.150.0060.01217.40
7.4.140.0110.00917.86
7.4.130.0110.00816.52
7.4.120.0100.00816.51
7.4.110.0120.00616.58
7.4.100.0120.00616.45
7.4.90.0060.01316.47
7.4.80.0080.01519.39
7.4.70.0070.01116.63
7.4.60.0090.00916.40
7.4.50.0030.00516.43
7.4.40.0070.01122.77
7.4.30.0030.01316.68
7.4.00.0070.00914.85
7.3.330.0040.00413.38
7.3.320.0050.00013.45
7.3.310.0040.00416.41
7.3.300.0060.00016.29
7.3.290.0130.00016.45
7.3.280.0080.00916.42
7.3.270.0190.00017.40
7.3.260.0130.00816.55
7.3.250.0130.00416.38
7.3.240.0070.01016.45
7.3.230.0090.01316.43
7.3.210.0120.00616.46
7.3.200.0130.00319.39
7.3.190.0180.00316.49
7.3.180.0030.01316.49
7.3.170.0070.00716.58
7.3.160.0070.01016.41
7.3.120.0050.01014.88
7.3.110.0000.01714.99
7.3.100.0030.01114.89
7.3.90.0060.00314.53
7.3.80.0060.00914.90
7.3.70.0060.00614.92
7.3.60.0090.00614.87
7.3.50.0070.00714.93
7.3.40.0070.00314.66
7.3.30.0000.01415.04
7.3.20.0100.00716.74
7.3.10.0120.00316.54
7.3.00.0080.00616.51
7.2.330.0120.00616.86
7.2.320.0080.01616.72
7.2.310.0140.00416.80
7.2.300.0090.00916.77
7.2.290.0070.01016.71
7.2.250.0100.01015.22
7.2.240.0060.01315.26
7.2.230.0100.00715.29
7.2.220.0040.01115.00
7.2.210.0070.01015.21
7.2.200.0070.01015.13
7.2.190.0030.01314.80
7.2.180.0120.00014.84
7.2.170.0040.01115.22
7.2.130.0120.00516.59
7.2.120.0030.00616.82
7.2.110.0040.00816.75
7.2.100.0040.00616.65
7.2.90.0160.00216.87
7.2.80.0150.00616.76
7.2.70.0150.00716.83
7.2.60.0070.01017.01
7.2.50.0110.00516.84
7.2.40.0090.00916.92
7.2.30.0090.00716.91
7.2.20.0030.01116.92
7.2.10.0070.00816.96
7.2.00.0070.00617.71
7.1.330.0080.00415.48
7.1.320.0040.00715.98
7.1.310.0050.00515.68
7.1.300.0070.01015.79
7.1.290.0060.00615.47
7.1.280.0080.00615.83
7.1.270.0060.01215.79
7.1.260.0080.00415.77
7.1.250.0070.00515.56
7.1.100.0030.00617.88
7.1.70.0000.00717.01
7.1.60.0070.01819.82
7.1.50.0170.00716.98
7.1.00.0130.06722.33
7.0.200.0030.00616.73
7.0.140.0030.07322.22
7.0.100.0130.04019.89
7.0.90.0070.08719.89
7.0.80.0000.04719.91
7.0.70.0130.07319.94
7.0.60.0070.08320.03
7.0.50.0070.08720.30
7.0.40.0030.04320.15
7.0.30.0070.04020.04
7.0.20.0030.05020.08
7.0.10.0030.04320.12
7.0.00.0130.03319.99
5.6.280.0000.07721.19
5.6.250.0170.07720.72
5.6.240.0100.06320.63
5.6.230.0100.08020.66
5.6.220.0170.07020.64
5.6.210.0170.06320.56
5.6.200.0130.06721.19
5.6.190.0070.04021.16
5.6.180.0030.05021.11
5.6.170.0070.04321.13
5.6.160.0130.03321.11
5.6.150.0000.04321.11
5.6.140.0030.04721.09
5.6.130.0070.04021.08
5.6.120.0000.06321.07
5.6.110.0130.07321.00
5.6.100.0000.04721.04
5.6.90.0100.03721.17
5.6.80.0070.04020.50
5.6.70.0030.04020.56
5.6.60.0030.03720.47
5.6.50.0000.05020.61
5.6.40.0000.04320.46
5.6.30.0030.04020.54
5.6.20.0070.04020.42
5.6.10.0070.04720.48
5.6.00.0130.03020.46
5.5.380.0200.07020.50
5.5.370.0200.07020.36
5.5.360.0130.06720.44
5.5.350.0170.07720.42
5.5.340.0100.08020.84
5.5.330.0070.04020.86
5.5.320.0030.04320.96
5.5.310.0030.04720.81
5.5.300.0070.03320.92
5.5.290.0030.04320.88
5.5.280.0030.04320.85
5.5.270.0030.08320.90
5.5.260.0000.04720.83
5.5.250.0030.05320.78
5.5.240.0030.04020.27
5.5.230.0030.05020.25
5.5.220.0070.03720.18
5.5.210.0000.04320.25
5.5.200.0070.03720.04
5.5.190.0000.04320.23
5.5.180.0000.04320.31
5.5.160.0030.04020.32
5.5.150.0070.04020.19
5.5.140.0070.03320.12
5.5.130.0070.03720.12
5.5.120.0100.03320.29
5.5.110.0030.04020.25
5.5.100.0030.04020.12
5.5.90.0030.03720.04
5.5.80.0070.03720.11
5.5.70.0030.04020.11
5.5.60.0070.03320.11
5.5.50.0030.04020.04
5.5.40.0100.03320.19
5.5.30.0030.03319.98
5.5.20.0070.03020.19
5.5.10.0030.04320.07
5.5.00.0130.06720.00
5.4.450.0070.03719.40
5.4.440.0030.06719.36
5.4.430.0100.07019.37
5.4.420.0030.04019.22
5.4.410.0070.04019.32
5.4.400.0070.03719.05
5.4.390.0030.04019.18
5.4.380.0030.04018.90
5.4.370.0100.04018.95
5.4.360.0000.04019.20
5.4.350.0030.03319.03
5.4.340.0030.03719.03
5.4.320.0030.04019.03
5.4.310.0070.03319.13
5.4.300.0000.04019.24
5.4.290.0000.04019.20
5.4.280.0030.03719.04
5.4.270.0130.04319.13
5.4.260.0000.04019.04
5.4.250.0070.03318.84
5.4.240.0070.04719.20
5.4.230.0000.04019.04
5.4.220.0030.04019.03
5.4.210.0000.04018.89
5.4.200.0000.04319.11
5.4.190.0030.03719.04
5.4.180.0030.04718.93
5.4.170.0100.05719.04
5.4.160.0030.08319.07
5.4.150.0100.06319.04
5.4.140.0130.06316.41
5.4.130.0130.06716.31
5.4.120.0030.05716.40
5.4.110.0070.07316.56
5.4.100.0030.03716.44
5.4.90.0070.07316.45
5.4.80.0030.07716.43
5.4.70.0070.07316.36
5.4.60.0030.07016.32
5.4.50.0070.03716.45
5.4.40.0130.03716.36
5.4.30.0070.06316.40
5.4.20.0070.05316.46
5.4.10.0000.05016.46
5.4.00.0100.07015.89
5.3.290.0000.04314.79
5.3.280.0070.04714.60
5.3.270.0000.04314.57
5.3.260.0030.08014.54
5.3.250.0030.06014.56
5.3.240.0000.08014.71
5.3.230.0100.07314.52
5.3.220.0030.07714.56
5.3.210.0070.08014.52
5.3.200.0070.07314.54
5.3.190.0030.04714.55
5.3.180.0070.07314.52
5.3.170.0070.06714.56
5.3.160.0070.04314.52
5.3.150.0070.06314.58
5.3.140.0070.07314.65
5.3.130.0130.07314.58
5.3.120.0070.07014.50
5.3.110.0030.07014.52
5.3.100.0100.06314.07
5.3.90.0100.07314.11
5.3.80.0000.05714.05
5.3.70.0030.07714.05
5.3.60.0130.07314.00
5.3.50.0070.07714.01
5.3.40.0100.05713.86
5.3.30.0070.07013.89
5.3.20.0070.06713.76
5.3.10.0100.05313.65
5.3.00.0070.06313.71
5.2.170.0070.06011.18
5.2.160.0070.06011.26
5.2.150.0030.06011.19
5.2.140.0070.04311.03
5.2.130.0030.04710.96
5.2.120.0030.06711.15
5.2.110.0030.05711.01
5.2.100.0030.06010.98
5.2.90.0100.05711.16
5.2.80.0030.06711.16
5.2.70.0070.07011.15
5.2.60.0030.06010.97
5.2.50.0070.03010.88
5.2.40.0030.06310.99
5.2.30.0100.04710.83
5.2.20.0100.05310.87
5.2.10.0070.05010.78
5.2.00.0070.05010.75
5.1.60.0030.0539.85
5.1.50.0070.04010.00
5.1.40.0070.03310.04
5.1.30.0030.05010.27
5.1.20.0070.05710.36
5.1.10.0030.06010.15
5.1.00.0000.04310.06
5.0.50.0030.0409.50
5.0.40.0000.0509.50
5.0.30.0030.0509.50
5.0.20.0000.0479.50
5.0.10.0000.0379.50
5.0.00.0000.0409.50
4.4.90.0030.0239.50
4.4.80.0100.0309.50
4.4.70.0000.0209.50
4.4.60.0070.0339.50
4.4.50.0000.0239.50
4.4.40.0030.0509.50
4.4.30.0000.0309.50
4.4.20.0070.0379.50
4.4.10.0070.0279.50
4.4.00.0000.0539.50
4.3.110.0030.0379.50
4.3.100.0000.0239.50
4.3.90.0030.0309.50
4.3.80.0030.0539.50
4.3.70.0000.0309.50
4.3.60.0030.0309.50
4.3.50.0070.0339.50
4.3.40.0030.0479.50
4.3.30.0000.0379.50
4.3.20.0000.0409.50
4.3.10.0070.0309.50
4.3.00.0000.0239.50

preferences:
54.08 ms | 400 KiB | 5 Q