3v4l.org

run code in 300+ PHP versions simultaneously
<?php function breakPartitionsLongerThan ($partitions, $length) { $ret = array(); foreach ($partitions as $partition) { $chunks = array_chunk ($partition, $length); if (count($chunks) > 1) for ($i = 0; $i < count ($chunks) - 1; $i++) // for every chunk except the last one, append the first address of the next chunk. $chunks[$i][] = $chunks[$i+1][0]; $ret = array_merge ($ret, $chunks); } return $ret; } var_dump (breakPartitionsLongerThan([1,2,3,4,5,6,7,8,9,10], 2));

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.0120.00918.68
8.3.50.0150.00821.11
8.3.40.0070.00718.71
8.3.30.0100.00319.01
8.3.20.0040.00420.16
8.3.10.0040.00421.87
8.3.00.0040.00419.38
8.2.180.0120.00318.66
8.2.170.0100.00322.96
8.2.160.0100.00320.47
8.2.150.0000.00724.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00422.06
8.2.110.0060.00320.39
8.2.100.0110.00018.03
8.2.90.0030.00519.08
8.2.80.0080.00017.97
8.2.70.0060.00317.63
8.2.60.0030.00617.93
8.2.50.0040.00418.07
8.2.40.0040.00419.82
8.2.30.0040.00418.11
8.2.20.0000.00717.66
8.2.10.0000.00718.00
8.2.00.0000.00717.82
8.1.280.0140.00325.92
8.1.270.0030.00522.18
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0000.00823.84
8.1.230.0060.00619.16
8.1.220.0080.00017.80
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0060.00317.25
8.1.180.0040.00418.10
8.1.170.0000.00818.71
8.1.160.0050.00322.02
8.1.150.0000.00818.84
8.1.140.0070.00017.38
8.1.130.0050.00317.89
8.1.120.0040.00417.40
8.1.110.0000.00817.43
8.1.100.0050.00317.46
8.1.90.0000.00717.34
8.1.80.0040.00417.49
8.1.70.0070.00017.34
8.1.60.0030.00617.51
8.1.50.0050.00317.53
8.1.40.0080.00017.51
8.1.30.0030.00517.62
8.1.20.0040.00417.57
8.1.10.0000.00717.62
8.1.00.0070.00017.40
8.0.300.0070.00018.77
8.0.290.0000.00816.75
8.0.280.0030.00318.46
8.0.270.0040.00417.14
8.0.260.0000.00717.33
8.0.250.0030.00317.01
8.0.240.0040.00417.05
8.0.230.0000.00816.91
8.0.220.0080.00016.95
8.0.210.0000.00716.93
8.0.200.0000.00816.95
8.0.190.0060.00316.95
8.0.180.0000.00716.88
8.0.170.0030.00616.98
8.0.160.0080.00016.88
8.0.150.0040.00416.86
8.0.140.0000.00716.95
8.0.130.0050.00013.36
8.0.120.0050.00316.94
8.0.110.0060.00317.00
8.0.100.0040.00416.84
8.0.90.0030.00616.91
8.0.80.0060.00917.01
8.0.70.0090.00017.01
8.0.60.0000.00816.91
8.0.50.0040.00417.03
8.0.30.0090.01317.21
8.0.20.0130.00517.40
8.0.10.0000.00716.90
8.0.00.0040.01316.70
7.4.330.0020.00215.00
7.4.320.0030.00316.47
7.4.300.0030.00316.54
7.4.290.0030.00316.53
7.4.280.0030.00316.42
7.4.270.0000.00716.47
7.4.260.0060.00316.53
7.4.250.0000.00716.50
7.4.240.0050.00216.58
7.4.230.0000.00816.40
7.4.220.0040.01316.46
7.4.210.0100.00316.56
7.4.200.0040.00416.61
7.4.160.0110.00416.39
7.4.150.0120.00617.40
7.4.140.0090.00817.86
7.4.130.0110.00916.53
7.4.120.0080.01116.58
7.4.110.0110.00716.55
7.4.100.0150.00416.59
7.4.90.0070.01016.58
7.4.80.0070.01019.39
7.4.70.0100.00716.61
7.4.60.0050.01416.70
7.4.50.0000.00916.71
7.4.40.0060.01216.42
7.4.30.0080.00816.56
7.4.00.0040.00414.98
7.3.330.0050.00013.25
7.3.320.0000.00513.32
7.3.310.0050.00316.23
7.3.300.0000.00816.34
7.3.290.0040.01016.40
7.3.280.0100.00816.40
7.3.270.0060.01217.40
7.3.260.0060.01116.41
7.3.250.0100.00816.48
7.3.240.0100.01016.50
7.3.230.0070.01416.42
7.3.210.0130.01116.42
7.3.200.0140.00919.39
7.3.190.0120.00916.57
7.3.180.0090.00616.44
7.3.170.0070.01016.37
7.3.160.0120.00516.70
7.2.330.0070.01016.39
7.2.320.0110.00516.83
7.2.310.0100.00716.39
7.2.300.0150.00616.47
7.2.290.0170.00716.94
7.2.60.0080.00416.67
7.2.50.0110.00716.88
7.2.00.0060.00619.39
7.1.200.0000.01015.82
7.1.100.0070.00718.09
7.1.70.0000.01117.20
7.1.60.0090.01219.11
7.1.50.0100.01016.91
7.1.00.0070.07322.46
7.0.200.0000.00716.89
7.0.140.0030.07322.15
7.0.60.0030.08720.01
7.0.50.0100.06717.87
7.0.40.0000.10020.09
7.0.30.0470.05020.26
7.0.20.0300.05320.22
7.0.10.0070.05720.07
7.0.00.0170.04020.23
5.6.280.0070.07021.08
5.6.210.0130.06720.65
5.6.200.0000.05018.19
5.6.190.0100.04020.46
5.6.180.0230.08320.48
5.6.170.0330.06720.50
5.6.160.0070.08720.44
5.6.150.0130.06718.21
5.6.140.0100.07718.21
5.6.130.0100.07718.11
5.6.120.0030.04020.85
5.6.110.0170.06320.96
5.6.100.0070.06320.99
5.6.90.0130.07021.13
5.6.80.0130.07720.36
5.5.350.0130.08320.41
5.5.340.0030.04017.95
5.5.330.0000.04720.35
5.5.320.0370.08020.24
5.5.310.0200.08320.51
5.5.300.0030.07718.07
5.5.290.0070.08317.96
5.5.280.0100.08020.66
5.5.270.0070.03720.96
5.5.260.0200.06720.81
5.5.250.0030.05320.78
5.5.240.0230.07320.16
5.4.450.0630.06319.46
5.4.440.0700.06319.70
5.4.430.0500.05719.16
5.4.420.0630.00019.21
5.4.410.0770.00019.41
5.4.400.0630.00019.25
5.4.390.0630.00019.17
5.4.380.0800.00019.09
5.4.370.0630.00019.21
5.4.360.0630.00019.21
5.4.350.0700.00018.99
5.4.340.0060.03512.02
5.4.320.0030.03912.50
5.4.310.0040.04712.50
5.4.300.0090.03412.50
5.4.290.0060.04412.50
5.4.280.0090.03412.40
5.4.270.0070.04912.39
5.4.260.0100.04212.40
5.4.250.0030.04112.39
5.4.240.0050.04412.40
5.4.230.0050.04412.39
5.4.220.0090.03712.39
5.4.210.0040.04312.39
5.4.200.0050.03812.39
5.4.190.0030.03912.39
5.4.180.0060.03512.39
5.4.170.0060.03512.40
5.4.160.0050.03512.39
5.4.150.0050.03712.39
5.4.140.0070.03812.07
5.4.130.0040.03612.05
5.4.120.0050.03512.02
5.4.110.0040.03812.01
5.4.100.0060.03512.01
5.4.90.0040.03812.01
5.4.80.0050.03812.01
5.4.70.0050.03412.01
5.4.60.0090.03012.01
5.4.50.0050.03612.01
5.4.40.0090.03112.00
5.4.30.0060.03411.99
5.4.20.0070.03311.99
5.4.10.0110.03511.99
5.4.00.0060.03511.48
5.3.290.0060.03912.80
5.3.280.0040.03912.71
5.3.270.0070.03712.73
5.3.260.0070.03812.72
5.3.250.0050.04012.72
5.3.240.0090.03912.71
5.3.230.0090.03812.71
5.3.220.0120.03012.68
5.3.210.0070.03712.68
5.3.200.0060.03512.68
5.3.190.0080.03412.68
5.3.180.0040.03712.67
5.3.170.0080.03812.66
5.3.160.0060.03612.67
5.3.150.0030.04412.67
5.3.140.0050.03612.66
5.3.130.0050.03912.66
5.3.120.0060.03912.66
5.3.110.0060.03912.66
5.3.100.0050.03712.12
5.3.90.0060.03512.10
5.3.80.0060.03512.09
5.3.70.0060.03512.09
5.3.60.0060.03512.08
5.3.50.0060.03612.02
5.3.40.0060.03512.03
5.3.30.0050.03612.00
5.3.20.0060.03411.77
5.3.10.0020.03711.73
5.3.00.0070.03411.72
5.2.170.0040.0309.22
5.2.160.0050.0289.22
5.2.150.0080.0279.22
5.2.140.0110.0299.22
5.2.130.0040.0399.18
5.2.120.0020.0339.18
5.2.110.0030.0309.18
5.2.100.0030.0299.18
5.2.90.0020.0319.18
5.2.80.0050.0299.18
5.2.70.0030.0319.18
5.2.60.0040.0319.13
5.2.50.0060.0289.10
5.2.40.0030.0309.07
5.2.30.0050.0399.05
5.2.20.0020.0329.04
5.2.10.0040.0298.94
5.2.00.0040.0298.81
5.1.60.0030.0248.09
5.1.50.0010.0278.09
5.1.40.0020.0268.07
5.1.30.0040.0268.42
5.1.20.0080.0228.44
5.1.10.0040.0258.17
5.1.00.0020.0278.16
5.0.50.0050.0186.64
5.0.40.0040.0186.51
5.0.30.0020.0326.32
5.0.20.0040.0186.28
5.0.10.0030.0196.27
5.0.00.0030.0316.26
4.4.90.0020.0174.78
4.4.80.0030.0154.75
4.4.70.0030.0164.76
4.4.60.0010.0174.75
4.4.50.0020.0164.77
4.4.40.0020.0254.71
4.4.30.0060.0124.76
4.4.20.0020.0164.85
4.4.10.0040.0224.85
4.4.00.0050.0234.76
4.3.110.0010.0174.67
4.3.100.0020.0154.67
4.3.90.0010.0164.64
4.3.80.0050.0214.58
4.3.70.0030.0144.63
4.3.60.0030.0144.63
4.3.50.0050.0134.63
4.3.40.0030.0234.54
4.3.30.0020.0163.31
4.3.20.0010.0183.29
4.3.10.0030.0153.25
4.3.00.0000.0237.18

preferences:
51.64 ms | 400 KiB | 5 Q