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]], 1));

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.00318.43
8.3.50.0300.00621.20
8.3.40.0070.00718.76
8.3.30.0100.00319.05
8.3.20.0050.00320.25
8.3.10.0050.00321.77
8.3.00.0080.00019.23
8.2.180.0120.00416.75
8.2.170.0070.00722.96
8.2.160.0070.01120.32
8.2.150.0050.00524.18
8.2.140.0040.00424.66
8.2.130.0000.00926.16
8.2.120.0080.00022.14
8.2.110.0060.00320.99
8.2.100.0080.00317.78
8.2.90.0050.00319.22
8.2.80.0080.00017.97
8.2.70.0040.00417.63
8.2.60.0030.00518.05
8.2.50.0060.00318.22
8.2.40.0040.00420.46
8.2.30.0000.00719.27
8.2.20.0000.00717.77
8.2.10.0070.00018.19
8.2.00.0000.01017.73
8.1.280.0100.01325.92
8.1.270.0000.00822.20
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0050.00522.69
8.1.230.0070.00417.95
8.1.220.0040.00417.76
8.1.210.0030.00618.77
8.1.200.0030.00617.23
8.1.190.0040.00417.36
8.1.180.0000.00718.10
8.1.170.0040.00418.59
8.1.160.0040.00418.86
8.1.150.0040.00418.80
8.1.140.0040.00417.44
8.1.130.0050.00217.83
8.1.120.0040.00417.36
8.1.110.0040.00417.53
8.1.100.0040.00417.37
8.1.90.0070.00017.49
8.1.80.0000.00717.48
8.1.70.0000.00717.42
8.1.60.0030.00617.59
8.1.50.0040.00417.51
8.1.40.0040.00417.51
8.1.30.0030.00617.70
8.1.20.0030.00517.63
8.1.10.0030.00617.52
8.1.00.0060.00317.31
8.0.300.0050.00218.77
8.0.290.0020.00516.63
8.0.280.0040.00418.45
8.0.270.0070.00016.81
8.0.260.0080.00017.28
8.0.250.0030.00316.86
8.0.240.0000.00816.82
8.0.230.0040.00417.01
8.0.220.0000.00916.95
8.0.210.0040.00416.88
8.0.200.0040.00416.88
8.0.190.0070.00416.94
8.0.180.0050.00316.88
8.0.170.0080.00016.84
8.0.160.0070.00016.92
8.0.150.0040.00416.86
8.0.140.0000.00816.89
8.0.130.0060.00013.35
8.0.120.0040.00416.85
8.0.110.0000.00916.92
8.0.100.0080.00016.72
8.0.90.0040.00416.84
8.0.80.0090.00616.93
8.0.70.0000.00816.84
8.0.60.0040.00416.78
8.0.50.0040.00416.82
8.0.30.0090.01117.04
8.0.20.0070.01217.40
8.0.10.0040.00417.05
8.0.00.0130.00416.73
7.4.330.0000.00615.00
7.4.320.0030.00316.52
7.4.300.0030.00316.49
7.4.290.0000.00816.62
7.4.280.0030.00316.42
7.4.270.0070.00016.53
7.4.260.0000.00816.50
7.4.250.0040.00416.45
7.4.240.0020.00616.53
7.4.230.0030.00616.52
7.4.220.0100.01016.69
7.4.210.0000.01416.55
7.4.200.0030.00316.43
7.4.160.0100.00716.60
7.4.150.0110.01117.40
7.4.140.0070.01417.86
7.4.130.0130.00616.60
7.4.120.0100.00716.53
7.4.110.0070.01116.53
7.4.100.0160.00316.57
7.4.90.0060.01316.50
7.4.80.0120.00619.39
7.4.70.0120.00516.68
7.4.60.0050.01316.53
7.4.50.0060.00316.33
7.4.40.0170.00016.50
7.4.30.0040.01216.32
7.4.00.0060.01315.19
7.3.330.0030.00213.25
7.3.320.0000.00513.39
7.3.310.0000.00716.48
7.3.300.0030.00316.25
7.3.290.0050.01016.40
7.3.280.0100.00616.35
7.3.270.0130.01317.40
7.3.260.0160.00316.54
7.3.250.0070.01016.47
7.3.240.0060.01316.46
7.3.230.0030.01416.39
7.3.210.0060.00916.30
7.3.200.0090.00919.39
7.3.190.0110.00816.68
7.3.180.0130.00316.36
7.3.170.0060.01216.57
7.3.160.0030.01316.47
7.2.330.0110.01116.73
7.2.320.0100.00716.90
7.2.310.0150.00316.85
7.2.300.0100.00716.75
7.2.290.0120.00916.64
7.2.00.0030.01419.32
7.1.100.0040.00817.97
7.1.70.0040.00417.06
7.1.60.0120.00019.11
7.1.50.0120.00634.81
7.1.00.0030.07722.45
7.0.200.0040.00416.80
7.0.140.0070.07022.18
7.0.60.0100.07319.95
7.0.50.0070.06017.86
7.0.40.0070.04320.11
7.0.30.0430.05320.15
7.0.20.0230.08720.23
7.0.10.0030.08320.25
7.0.00.0070.06320.24
5.6.280.0070.06721.02
5.6.210.0070.07020.50
5.6.200.0100.08018.25
5.6.190.0200.07020.50
5.6.180.0230.08020.68
5.6.170.0300.07320.57
5.6.160.0030.09320.50
5.6.150.0030.07318.15
5.6.140.0100.06718.21
5.6.130.0230.05318.25
5.6.120.0070.04020.79
5.6.110.0070.06021.12
5.6.100.0070.08321.00
5.6.90.0070.07020.89
5.6.80.0130.04720.50
5.5.350.0130.08020.42
5.5.340.0070.03718.09
5.5.330.0100.07320.19
5.5.320.0370.07020.19
5.5.310.0270.07320.19
5.5.300.0130.06718.08
5.5.290.0070.04318.02
5.5.280.0100.08020.66
5.5.270.0030.04320.87
5.5.260.0130.07720.93
5.5.250.0030.05320.50
5.5.240.0370.06020.16
5.4.450.0770.05719.31
5.4.440.0670.06319.47
5.4.430.0630.06719.64
5.4.420.0630.00019.53
5.4.410.0800.00019.21
5.4.400.0630.00019.23
5.4.390.0600.00019.12
5.4.380.0630.00019.27
5.4.370.0630.00019.13
5.4.360.0830.00019.02
5.4.350.0670.00019.10
5.4.340.0070.03912.02
5.4.320.0050.04512.50
5.4.310.0070.03712.50
5.4.300.0080.03412.50
5.4.290.0100.03412.50
5.4.280.0060.03412.40
5.4.270.0030.03912.40
5.4.260.0030.04112.40
5.4.250.0060.03712.40
5.4.240.0090.03412.40
5.4.230.0040.04012.39
5.4.220.0090.03412.39
5.4.210.0100.03412.39
5.4.200.0070.04312.39
5.4.190.0120.04112.39
5.4.180.0070.04412.38
5.4.170.0050.03712.40
5.4.160.0070.03612.39
5.4.150.0070.03512.38
5.4.140.0070.03612.07
5.4.130.0090.03212.06
5.4.120.0060.03512.02
5.4.110.0060.03612.02
5.4.100.0050.03612.02
5.4.90.0100.03312.01
5.4.80.0030.04012.01
5.4.70.0110.03112.01
5.4.60.0060.03412.01
5.4.50.0100.03312.01
5.4.40.0050.03512.00
5.4.30.0070.03612.00
5.4.20.0090.03211.99
5.4.10.0100.03111.99
5.4.00.0070.03611.48
5.3.290.0080.03812.80
5.3.280.0080.03612.71
5.3.270.0050.04012.73
5.3.260.0070.04012.72
5.3.250.0070.04312.72
5.3.240.0100.03412.72
5.3.230.0070.03712.71
5.3.220.0070.03512.68
5.3.210.0050.04012.68
5.3.200.0060.03712.68
5.3.190.0060.03812.68
5.3.180.0070.03512.67
5.3.170.0030.03912.67
5.3.160.0050.03712.67
5.3.150.0090.03512.67
5.3.140.0050.03712.66
5.3.130.0070.04212.65
5.3.120.0050.04012.66
5.3.110.0050.04012.65
5.3.100.0100.03312.13
5.3.90.0100.03212.11
5.3.80.0070.03412.09
5.3.70.0060.04612.09
5.3.60.0030.03912.08
5.3.50.0040.03912.02
5.3.40.0070.03712.03
5.3.30.0070.03311.98
5.3.20.0080.03211.77
5.3.10.0020.03711.73
5.3.00.0060.04511.71
5.2.170.0080.0359.22
5.2.160.0030.0309.22
5.2.150.0050.0299.21
5.2.140.0060.0319.22
5.2.130.0030.0309.18
5.2.120.0080.0259.17
5.2.110.0060.0299.18
5.2.100.0050.0329.18
5.2.90.0040.0289.18
5.2.80.0050.0289.18
5.2.70.0070.0279.18
5.2.60.0080.0329.13
5.2.50.0040.0329.10
5.2.40.0070.0259.07
5.2.30.0050.0299.05
5.2.20.0070.0279.04
5.2.10.0090.0248.94
5.2.00.0040.0298.82
5.1.60.0020.0258.09
5.1.50.0060.0248.09
5.1.40.0060.0238.07
5.1.30.0040.0268.42
5.1.20.0040.0298.44
5.1.10.0060.0248.16
5.1.00.0050.0248.16
5.0.50.0060.0176.65
5.0.40.0030.0196.50
5.0.30.0030.0306.32
5.0.20.0040.0186.29
5.0.10.0030.0206.27
5.0.00.0040.0296.26
4.4.90.0040.0134.78
4.4.80.0020.0154.75
4.4.70.0050.0134.75
4.4.60.0030.0184.75
4.4.50.0030.0154.77
4.4.40.0020.0304.71
4.4.30.0030.0194.76
4.4.20.0070.0154.85
4.4.10.0030.0254.85
4.4.00.0030.0304.76
4.3.110.0040.0204.67
4.3.100.0030.0184.66
4.3.90.0020.0154.64
4.3.80.0060.0204.58
4.3.70.0030.0224.63
4.3.60.0030.0144.63
4.3.50.0010.0244.62
4.3.40.0030.0284.54
4.3.30.0030.0223.31
4.3.20.0030.0193.29
4.3.10.0010.0203.25
4.3.00.0130.0207.16

preferences:
46.75 ms | 401 KiB | 5 Q