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 $_) { $it->next(); $chunk[] = $it->current(); 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.0160.00316.50
8.3.50.0360.00921.96
8.3.40.0120.00618.69
8.3.30.0190.01618.95
8.3.20.0030.00620.15
8.3.10.0110.00023.61
8.3.00.0000.01020.75
8.2.180.0130.01316.63
8.2.170.0070.01422.96
8.2.160.0410.01122.08
8.2.150.0070.00424.18
8.2.140.0170.00024.66
8.2.130.0090.00026.16
8.2.120.0190.00422.20
8.2.110.0070.00422.10
8.2.100.0140.00417.91
8.2.90.0030.00719.20
8.2.80.0050.00518.16
8.2.70.0070.01017.75
8.2.60.0100.00517.93
8.2.50.0030.00618.07
8.2.40.0140.00317.91
8.2.30.0090.00418.28
8.2.20.0040.00817.93
8.2.10.0040.00817.92
8.2.00.0000.01017.83
8.1.280.0090.00925.92
8.1.270.0160.00223.91
8.1.260.0330.00026.35
8.1.250.0090.00028.09
8.1.240.0190.00323.82
8.1.230.0100.00319.16
8.1.220.0130.00317.74
8.1.210.0180.00018.77
8.1.200.0060.00317.35
8.1.190.0000.01117.41
8.1.180.0120.00418.10
8.1.170.0040.00718.49
8.1.160.0080.01222.06
8.1.150.0110.00018.61
8.1.140.0120.00417.46
8.1.130.0040.00417.92
8.1.120.0000.00817.48
8.1.110.0080.00817.57
8.1.100.0060.00317.61
8.1.90.0130.00417.46
8.1.80.0050.00517.52
8.1.70.0070.00317.48
8.1.60.0110.01117.71
8.1.50.0120.00617.50
8.1.40.0060.01217.50
8.1.30.0000.01017.71
8.1.20.0110.00517.71
8.1.10.0030.00717.66
8.1.00.0060.00317.58
8.0.300.0090.00318.77
8.0.290.0110.00717.05
8.0.280.0080.00018.40
8.0.270.0040.01117.23
8.0.260.0130.00316.86
8.0.250.0120.00016.89
8.0.240.0100.00016.91
8.0.230.0040.00716.86
8.0.220.0030.00816.89
8.0.210.0080.00016.96
8.0.200.0040.00417.05
8.0.190.0120.00416.89
8.0.180.0060.00316.89
8.0.170.0030.00616.81
8.0.160.0070.01016.82
8.0.150.0000.00916.86
8.0.140.0090.00016.80
8.0.130.0050.00513.38
8.0.120.0090.00016.91
8.0.110.0090.00316.82
8.0.100.0160.00016.89
8.0.90.0060.00916.82
8.0.80.0040.01916.84
8.0.70.0040.00816.86
8.0.60.0060.00316.80
8.0.50.0080.00416.74
8.0.30.0440.02417.03
8.0.20.0390.02017.40
8.0.10.0060.00316.82
8.0.00.0450.02016.64
7.4.330.0070.00715.07
7.4.320.0030.00616.42
7.4.300.0100.00016.40
7.4.290.0080.00816.43
7.4.280.0100.00516.45
7.4.270.0040.00416.48
7.4.260.0000.01616.39
7.4.250.0050.00316.29
7.4.240.0070.00616.47
7.4.230.0060.00316.58
7.4.220.0100.02716.44
7.4.210.0270.03216.48
7.4.200.0000.01216.21
7.4.190.0050.00516.68
7.4.160.0070.03316.34
7.4.150.0530.01017.40
7.4.140.0320.03517.86
7.4.130.0280.02016.40
7.4.120.0500.01516.34
7.4.110.0410.01216.25
7.4.100.1040.03416.57
7.4.90.0650.02816.52
7.4.80.0440.02716.53
7.4.70.0340.02116.30
7.4.60.0070.02516.39
7.4.50.0070.00716.48
7.4.40.0060.01022.77
7.4.30.0310.02016.40
7.3.330.0060.00613.28
7.3.320.0030.00713.41
7.3.310.0040.00816.36
7.3.300.0040.00416.25
7.3.290.0100.01916.35
7.3.280.0210.01816.33
7.3.270.0460.01717.40
7.3.260.0340.02716.37
7.3.250.0530.01916.36
7.3.240.0290.01816.49
7.3.230.0710.01816.39
7.3.210.0730.04016.55
7.3.200.0370.02319.39
7.3.190.0220.02816.55
7.3.180.0520.02916.45
7.3.170.0720.03716.43
7.3.160.0270.02016.41
7.2.330.0300.02916.60
7.2.320.0460.01016.82
7.2.310.0450.02816.82
7.2.300.0200.03216.61
7.2.290.0600.04916.45
7.2.100.1310.01214.46
7.2.90.0260.01314.55
7.2.80.0370.00714.58
7.2.70.1200.01314.94
7.2.60.1010.01014.77
7.2.50.0290.01115.11
7.2.40.0400.00614.96
7.2.30.0320.00315.10
7.2.20.0340.01014.93
7.2.10.0140.02214.81
7.2.00.0400.00514.83
7.1.220.0130.01313.86
7.1.210.1010.01613.93
7.1.200.1060.01213.67
7.1.190.0530.01014.03
7.1.180.1080.01514.01
7.1.170.0370.00713.82
7.1.160.0250.00713.84
7.1.150.0140.02013.81
7.1.140.0560.00713.76
7.1.130.0620.01014.03
7.1.120.0930.00913.73
7.1.110.0150.00613.77
7.1.100.0220.01014.16
7.1.90.0500.00713.88
7.1.80.0730.01713.69
7.1.70.0270.00313.57
7.1.60.1080.00332.13
7.1.50.0750.01432.09
7.1.40.1110.01032.08
7.1.30.0320.01431.87
7.1.20.1110.02332.21
7.1.10.0910.00314.13
7.1.00.0980.00413.85
7.0.310.0500.00313.38
7.0.300.0240.01213.64
7.0.290.0820.01113.47
7.0.280.0640.00313.19
7.0.270.0190.01213.58
7.0.260.0280.01113.52
7.0.250.0390.01313.51
7.0.240.0180.01313.54
7.0.230.0320.01313.34
7.0.220.0210.00913.53
7.0.210.0980.01013.53
7.0.200.1020.00913.85
7.0.190.1040.01413.64
7.0.180.0170.01413.65
7.0.170.1150.01813.77
7.0.160.0240.00913.79
7.0.150.0930.00913.52
7.0.140.0890.00613.66
7.0.130.1130.00613.54
7.0.120.0120.01213.49
7.0.110.0940.00713.45
7.0.100.0320.00213.68
7.0.90.0150.01213.52
7.0.80.0230.01913.79
7.0.70.0700.00813.65
7.0.60.1330.01613.56
7.0.50.0200.00713.80
7.0.40.1230.00813.83
7.0.30.0180.00913.88
7.0.20.1810.02013.58
7.0.10.1760.01013.63
7.0.00.0200.01013.75
5.6.380.0300.00714.43
5.6.370.0100.01014.68
5.6.360.0270.00414.67
5.6.350.0080.01214.39
5.6.340.0120.01014.50
5.6.330.0230.00314.36
5.6.320.0160.01914.71
5.6.310.0150.01114.30
5.6.300.0040.01414.40
5.6.290.0180.00014.32
5.6.280.0110.01914.45
5.6.270.0240.01114.50
5.6.260.0080.01714.24
5.6.250.0110.01714.37
5.6.240.0070.01014.28
5.6.230.0190.00714.66
5.6.220.0180.00714.09
5.6.210.0200.01014.15
5.6.200.0170.01714.29
5.6.190.0050.01414.45
5.6.180.0150.01414.03
5.6.170.0350.01214.39
5.6.160.0230.01514.39
5.6.150.0160.00414.39
5.6.140.0120.01314.55
5.6.130.0140.01714.11
5.6.120.0250.00414.53
5.6.110.0120.01614.32
5.6.100.0310.02014.30
5.6.90.0140.01914.27
5.6.80.0330.01514.36
5.6.70.0090.01814.08
5.6.60.0120.01714.41
5.6.50.0130.00914.59
5.6.40.0200.01514.54
5.6.30.0180.01014.58
5.6.20.0230.01114.30
5.5.380.0080.01712.09
5.5.370.0290.00612.09
5.5.360.0190.01212.09
5.5.350.0150.01012.09
5.5.340.0130.01112.09
5.5.330.0060.01712.09
5.5.320.0280.01112.09
5.5.310.0160.01612.09
5.5.300.0130.00912.09
5.5.290.0080.01512.09
5.5.280.0170.02212.09
5.5.270.0170.00812.09
5.5.260.0220.01612.09
5.5.250.0090.00912.09
5.5.240.0180.01112.09
5.5.230.0100.00912.09
5.5.220.0140.01112.09
5.5.210.0070.01412.09
5.5.200.0090.00812.09
5.5.190.0180.00312.09
5.4.450.0030.00812.09
5.4.440.0020.01012.09
5.4.430.0060.00312.09
5.4.420.0060.00312.09
5.4.410.0040.00712.09
5.4.400.0050.00512.09
5.4.390.0000.01112.09
5.4.380.0000.00812.09
5.4.370.0100.00312.09
5.4.360.0090.00312.09
5.4.350.0050.00312.09

preferences:
37.81 ms | 401 KiB | 5 Q