3v4l.org

run code in 300+ PHP versions simultaneously
<?php function breakPartitionsLongerThan ($partitions, $length) { $ret = array(); $partition = call_user_func_array ('array_merge', $partitions); $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]], 6));

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.70.0100.01016.75
8.3.60.0080.00818.30
8.3.50.0130.00721.26
8.3.40.0090.00618.79
8.3.30.0110.00419.07
8.3.20.0070.00020.30
8.3.10.0080.00021.73
8.3.00.0000.00819.38
8.2.180.0160.00618.16
8.2.170.0110.00422.96
8.2.160.0110.00320.39
8.2.150.0070.00024.18
8.2.140.0000.00924.66
8.2.130.0070.00426.16
8.2.120.0040.00422.09
8.2.110.0100.00020.37
8.2.100.0110.00017.97
8.2.90.0080.00019.17
8.2.80.0000.00817.97
8.2.70.0060.00317.50
8.2.60.0040.00418.03
8.2.50.0030.00618.07
8.2.40.0040.00419.97
8.2.30.0000.00718.19
8.2.20.0020.00517.67
8.2.10.0040.00418.20
8.2.00.0000.00717.68
8.1.280.0100.01025.92
8.1.270.0060.00322.19
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0060.00323.70
8.1.230.0120.00019.07
8.1.220.0000.00817.79
8.1.210.0050.00318.77
8.1.200.0030.00617.23
8.1.190.0030.00617.25
8.1.180.0000.00718.10
8.1.170.0080.00018.66
8.1.160.0070.00021.95
8.1.150.0060.00618.94
8.1.140.0040.00417.48
8.1.130.0070.00017.76
8.1.120.0040.00417.53
8.1.110.0030.00517.32
8.1.100.0070.00017.51
8.1.90.0000.00817.42
8.1.80.0030.00317.51
8.1.70.0000.00717.39
8.1.60.0060.00317.64
8.1.50.0030.00517.50
8.1.40.0090.00017.49
8.1.30.0060.00317.54
8.1.20.0000.00817.56
8.1.10.0020.00517.50
8.1.00.0000.00817.47
8.0.300.0000.00718.77
8.0.290.0000.00816.75
8.0.280.0000.00818.39
8.0.270.0000.00717.12
8.0.260.0030.00317.11
8.0.250.0030.00316.82
8.0.240.0060.00316.79
8.0.230.0000.00616.92
8.0.220.0040.00416.87
8.0.210.0000.00616.84
8.0.200.0000.00816.79
8.0.190.0000.00916.80
8.0.180.0000.00916.79
8.0.170.0040.00416.99
8.0.160.0000.00716.84
8.0.150.0030.00316.89
8.0.140.0040.00416.88
8.0.130.0060.00013.42
8.0.120.0000.00716.70
8.0.110.0000.00916.93
8.0.100.0040.00416.74
8.0.90.0040.00416.73
8.0.80.0120.00316.86
8.0.70.0040.00416.97
8.0.60.0000.00816.70
8.0.50.0040.00416.97
8.0.30.0160.00617.18
8.0.20.0060.01517.40
8.0.10.0000.00816.91
8.0.00.0120.00516.85
7.4.330.0000.00615.00
7.4.320.0050.00216.57
7.4.300.0030.00316.63
7.4.290.0040.00416.37
7.4.280.0070.00016.65
7.4.270.0000.00716.63
7.4.260.0070.00416.50
7.4.250.0070.00016.49
7.4.240.0050.00216.61
7.4.230.0070.00016.61
7.4.220.0120.01216.41
7.4.210.0070.00716.64
7.4.200.0000.00716.60
7.4.160.0080.00816.46
7.4.150.0130.00717.40
7.4.140.0090.01217.86
7.4.130.0060.01316.43
7.4.120.0120.00816.48
7.4.110.0110.00716.57
7.4.100.0110.00716.52
7.4.90.0060.01316.45
7.4.80.0090.01219.39
7.4.70.0110.00716.67
7.4.60.0140.00316.42
7.4.50.0030.00316.15
7.4.40.0140.00316.39
7.4.30.0100.01016.61
7.4.00.0060.01214.99
7.3.330.0050.00013.31
7.3.320.0030.00313.43
7.3.310.0070.00016.20
7.3.300.0000.00716.32
7.3.290.0090.00516.38
7.3.280.0120.00816.38
7.3.270.0070.01117.40
7.3.260.0140.00816.38
7.3.250.0080.01016.42
7.3.240.0060.01316.63
7.3.230.0070.01116.55
7.3.210.0080.00916.51
7.3.200.0140.00919.39
7.3.190.0070.01116.37
7.3.180.0120.00916.54
7.3.170.0080.01116.48
7.3.160.0100.00716.57
7.2.330.0120.00416.59
7.2.320.0090.01116.74
7.2.310.0120.00916.48
7.2.300.0110.00616.48
7.2.290.0100.01416.80
7.1.70.0030.00617.13
7.1.60.0120.00619.11
7.1.50.0130.00334.75
7.1.00.0000.08022.56
7.0.200.0000.00816.67
7.0.140.0030.07022.18
7.0.60.0100.08319.93
7.0.50.0100.06017.91
7.0.40.0100.07319.96
7.0.30.0770.07020.07
7.0.20.0170.04720.09
7.0.10.0230.05720.13
7.0.00.0000.09320.07
5.6.280.0070.06721.12
5.6.210.0070.08020.48
5.6.200.0100.04718.22
5.6.190.0130.05720.48
5.6.180.4100.04320.55
5.6.170.0230.08720.47
5.6.160.0130.08020.47
5.6.150.0070.03718.15
5.6.140.0070.06718.11
5.6.130.0070.07318.11
5.6.120.0070.04321.02
5.6.110.0100.08020.99
5.6.100.0130.06720.98
5.6.90.0100.08320.97
5.6.80.0130.05720.39
5.6.70.4330.04320.37
5.5.350.0270.07320.38
5.5.340.0030.07018.02
5.5.330.0130.06320.35
5.5.320.0230.07020.32
5.5.310.0300.07720.56
5.5.300.0070.07717.93
5.5.290.0100.04717.94
5.5.280.0200.06320.98
5.5.270.0030.04720.88
5.5.260.0130.08320.79
5.5.250.0070.07720.50
5.5.240.0230.06320.10
5.4.450.1230.04719.39
5.4.440.0270.05719.63
5.4.430.0300.04319.53
5.4.420.0870.00019.51
5.4.410.0630.00019.57
5.4.400.0630.00019.07
5.4.390.0630.00019.13
5.4.380.0630.00019.21
5.4.370.0600.00019.13
5.4.360.0770.00019.16
5.4.350.0630.00019.05
5.4.340.0040.03712.01
5.4.320.0050.03712.51
5.4.310.0070.03812.50
5.4.300.0090.03512.51
5.4.290.0090.03612.50
5.4.280.0060.03512.39
5.4.270.0040.03812.39
5.4.260.0060.03812.39
5.4.250.0080.03612.39
5.4.240.0060.03512.40
5.4.230.0050.03812.39
5.4.220.0030.03812.39
5.4.210.0050.03612.39
5.4.200.0040.04712.39
5.4.190.0060.04012.39
5.4.180.0080.03512.39
5.4.170.0080.03412.39
5.4.160.0050.03612.39
5.4.150.0080.03712.39
5.4.140.0070.03812.07
5.4.130.0080.03312.06
5.4.120.0050.03612.01
5.4.110.0070.03512.02
5.4.100.0050.03512.01
5.4.90.0070.03712.01
5.4.80.0090.03912.01
5.4.70.0040.03712.01
5.4.60.0050.03812.01
5.4.50.0070.03512.01
5.4.40.0070.03312.00
5.4.30.0040.03711.99
5.4.20.0050.03511.99
5.4.10.0060.03311.99
5.4.00.0090.03411.48
5.3.290.0090.03712.80
5.3.280.0100.03712.71
5.3.270.0110.03412.73
5.3.260.0100.03412.72
5.3.250.0070.03512.72
5.3.240.0080.03412.72
5.3.230.0070.03612.71
5.3.220.0090.03312.68
5.3.210.0080.03812.68
5.3.200.0070.04112.68
5.3.190.0080.03412.68
5.3.180.0050.03612.68
5.3.170.0060.03612.67
5.3.160.0090.03312.67
5.3.150.0090.04012.67
5.3.140.0030.03912.66
5.3.130.0090.03512.66
5.3.120.0070.03712.66
5.3.110.0090.03512.65
5.3.100.0070.03612.13
5.3.90.0030.03812.10
5.3.80.0050.03612.09
5.3.70.0030.04312.09
5.3.60.0070.03412.08
5.3.50.0090.04112.02
5.3.40.0090.04312.02
5.3.30.0050.03511.99
5.3.20.0090.03811.77
5.3.10.0050.03511.73
5.3.00.0050.03611.71
5.2.170.0050.0309.22
5.2.160.0040.0299.22
5.2.150.0030.0319.22
5.2.140.0040.0309.22
5.2.130.0050.0319.18
5.2.120.0050.0279.17
5.2.110.0030.0299.18
5.2.100.0050.0279.18
5.2.90.0080.0349.18
5.2.80.0050.0349.18
5.2.70.0030.0329.18
5.2.60.0020.0319.13
5.2.50.0080.0269.10
5.2.40.0060.0279.07
5.2.30.0030.0319.05
5.2.20.0070.0339.04
5.2.10.0060.0288.94
5.2.00.0050.0418.81
5.1.60.0050.0228.09
5.1.50.0050.0328.09
5.1.40.0050.0228.07
5.1.30.0030.0268.42
5.1.20.0050.0288.44
5.1.10.0040.0288.16
5.1.00.0020.0268.16
5.0.50.0040.0266.65
5.0.40.0040.0186.50
5.0.30.0050.0286.32
5.0.20.0040.0186.28
5.0.10.0050.0176.27
5.0.00.0030.0376.26
4.4.90.0030.0174.78
4.4.80.0020.0194.75
4.4.70.0030.0204.76
4.4.60.0040.0154.75
4.4.50.0030.0154.77
4.4.40.0060.0224.71
4.4.30.0030.0174.75
4.4.20.0040.0174.84
4.4.10.0020.0164.85
4.4.00.0030.0284.76
4.3.110.0030.0154.67
4.3.100.0010.0204.66
4.3.90.0030.0234.63
4.3.80.0030.0244.59
4.3.70.0030.0144.63
4.3.60.0020.0154.62
4.3.50.0020.0154.63
4.3.40.0030.0314.54
4.3.30.0000.0183.31
4.3.20.0010.0163.29
4.3.10.0010.0163.24
4.3.00.0300.01312.14

preferences:
67.58 ms | 401 KiB | 5 Q