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]], 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.0110.01118.40
8.3.50.0150.00921.09
8.3.40.0060.00918.96
8.3.30.0070.00719.23
8.3.20.0050.00320.29
8.3.10.0040.00421.77
8.3.00.0060.00319.38
8.2.180.0070.01118.38
8.2.170.0100.00618.76
8.2.160.0110.00722.96
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0000.00822.14
8.2.110.0060.00320.52
8.2.100.0090.00318.03
8.2.90.0050.00319.17
8.2.80.0050.00317.97
8.2.70.0030.00617.63
8.2.60.0050.00318.04
8.2.50.0000.00818.07
8.2.40.0060.00319.82
8.2.30.0080.00018.14
8.2.20.0050.00217.63
8.2.10.0000.00718.09
8.2.00.0040.00417.75
8.1.280.0150.00325.92
8.1.270.0060.00322.06
8.1.260.0060.00326.35
8.1.250.0070.00028.09
8.1.240.0060.00323.76
8.1.230.0080.00419.16
8.1.220.0030.00617.79
8.1.210.0040.00418.77
8.1.200.0060.00317.23
8.1.190.0060.00317.35
8.1.180.0040.00418.10
8.1.170.0000.00818.57
8.1.160.0000.00722.03
8.1.150.0110.00018.92
8.1.140.0000.00717.41
8.1.130.0040.00417.88
8.1.120.0000.00717.38
8.1.110.0030.00617.41
8.1.100.0040.00417.48
8.1.90.0000.00717.48
8.1.80.0070.00017.36
8.1.70.0000.00817.45
8.1.60.0030.00517.58
8.1.50.0000.00917.54
8.1.40.0060.00317.48
8.1.30.0060.00317.66
8.1.20.0030.00517.69
8.1.10.0000.00717.53
8.1.00.0000.00717.34
8.0.300.0040.00418.77
8.0.290.0000.00816.63
8.0.280.0040.00418.45
8.0.270.0020.00517.21
8.0.260.0070.00017.13
8.0.250.0040.00416.92
8.0.240.0080.00016.95
8.0.230.0000.00716.90
8.0.220.0030.00616.84
8.0.210.0030.00316.74
8.0.200.0000.00716.82
8.0.190.0090.00316.80
8.0.180.0050.00316.77
8.0.170.0100.00016.83
8.0.160.0070.00016.97
8.0.150.0080.00016.74
8.0.140.0000.00716.77
8.0.130.0000.00613.37
8.0.120.0000.00816.85
8.0.110.0000.00916.87
8.0.100.0080.00016.72
8.0.90.0040.00416.89
8.0.80.0070.01416.88
8.0.70.0040.00416.86
8.0.60.0040.00416.90
8.0.50.0000.00716.72
8.0.30.0110.01016.94
8.0.20.0070.01217.40
8.0.10.0050.00317.05
8.0.00.0100.00816.67
7.4.330.0000.00515.00
7.4.320.0000.00616.44
7.4.300.0060.00016.60
7.4.290.0040.00416.52
7.4.280.0030.00316.63
7.4.270.0000.00716.59
7.4.260.0040.00416.45
7.4.250.0040.00416.62
7.4.240.0050.00216.43
7.4.230.0000.00816.55
7.4.220.0000.01916.60
7.4.210.0000.01416.57
7.4.200.0050.00316.64
7.4.160.0090.00916.55
7.4.150.0030.01617.40
7.4.140.0120.00717.86
7.4.130.0110.00816.58
7.4.120.0050.01216.62
7.4.110.0060.01616.52
7.4.100.0100.01016.41
7.4.90.0070.01016.49
7.4.80.0050.01319.39
7.4.70.0100.00516.38
7.4.60.0050.01316.67
7.4.50.0000.00916.38
7.4.40.0140.00416.39
7.4.30.0090.00916.61
7.4.00.0140.00315.17
7.3.330.0060.00013.32
7.3.320.0060.00013.46
7.3.310.0070.00016.20
7.3.300.0000.00716.19
7.3.290.0100.00316.35
7.3.280.0100.00616.40
7.3.270.0120.00617.40
7.3.260.0080.00816.61
7.3.250.0090.00816.34
7.3.240.0120.00616.56
7.3.230.0090.01216.39
7.3.210.0100.00716.64
7.3.200.0090.00919.39
7.3.190.0050.01316.45
7.3.180.0110.00816.48
7.3.170.0080.00816.67
7.3.160.0130.01016.61
7.2.330.0120.00916.71
7.2.320.0090.00916.39
7.2.310.0060.01016.71
7.2.300.0150.00516.76
7.2.290.0040.01816.49
7.2.60.0050.00716.72
7.2.00.0070.00319.38
7.1.200.0030.00815.86
7.1.100.0000.01717.97
7.1.70.0000.00916.93
7.1.60.0080.00819.11
7.1.50.0240.01034.79
7.1.00.0070.07322.51
7.0.200.0030.00616.79
7.0.140.0070.07022.11
7.0.60.0030.08020.07
7.0.50.0130.06317.80
7.0.40.0170.07320.02
7.0.30.0200.04720.06
7.0.20.0230.08720.15
7.0.10.0030.07720.07
7.0.00.0170.03020.03
5.6.280.0030.07320.82
5.6.210.0070.08320.67
5.6.200.0070.08018.16
5.6.190.0030.05720.67
5.6.180.0200.07320.46
5.6.170.0230.05320.60
5.6.160.0100.08020.71
5.6.150.0030.04718.20
5.6.140.0200.02318.23
5.6.130.0070.08718.26
5.6.120.0070.04021.00
5.6.110.0070.06320.99
5.6.100.0130.05321.01
5.6.90.0070.05020.98
5.6.80.0100.08020.36
5.5.350.2900.03020.32
5.5.340.0070.05317.96
5.5.330.0070.08020.40
5.5.320.0330.07720.27
5.5.310.0270.07720.24
5.5.300.0070.08017.98
5.5.290.0030.04717.99
5.5.280.0000.06020.85
5.5.270.0070.05720.68
5.5.260.0200.06020.83
5.5.250.0000.04320.55
5.5.240.0030.03020.34
5.4.450.0670.06319.63
5.4.440.0800.05319.48
5.4.430.0830.05719.59
5.4.420.0670.00019.54
5.4.410.0630.00019.11
5.4.400.0630.00019.09
5.4.390.0630.00019.12
5.4.380.0630.00019.16
5.4.370.0630.00019.04
5.4.360.0630.00019.16
5.4.350.0630.00019.09
5.4.340.0050.03612.02
5.4.320.0090.03412.50
5.4.310.0050.03812.50
5.4.300.0060.03712.50
5.4.290.0080.03612.50
5.4.280.0080.03412.40
5.4.270.0060.03612.40
5.4.260.0090.03712.40
5.4.250.0080.03512.39
5.4.240.0040.03812.39
5.4.230.0090.03812.39
5.4.220.0070.03512.39
5.4.210.0060.03512.39
5.4.200.0080.03712.39
5.4.190.0050.03812.39
5.4.180.0090.03212.38
5.4.170.0040.03712.40
5.4.160.0040.03712.39
5.4.150.0070.03512.39
5.4.140.0070.03612.07
5.4.130.0050.03612.06
5.4.120.0080.03312.02
5.4.110.0060.03512.01
5.4.100.0040.04312.01
5.4.90.0090.03812.01
5.4.80.0040.03812.02
5.4.70.0040.03612.01
5.4.60.0080.03212.01
5.4.50.0060.03412.01
5.4.40.0030.03812.00
5.4.30.0050.03611.99
5.4.20.0050.03611.99
5.4.10.0030.03812.00
5.4.00.0060.03611.48
5.3.290.0030.04112.80
5.3.280.0070.03612.71
5.3.270.0060.03912.72
5.3.260.0080.03612.72
5.3.250.0050.03712.72
5.3.240.0040.03912.72
5.3.230.0100.03812.70
5.3.220.0080.04112.68
5.3.210.0040.04112.68
5.3.200.0080.03412.68
5.3.190.0100.03312.68
5.3.180.0050.03712.67
5.3.170.0060.03512.67
5.3.160.0060.03912.67
5.3.150.0070.03512.67
5.3.140.0060.03612.66
5.3.130.0100.03712.65
5.3.120.0070.03812.66
5.3.110.0060.03912.66
5.3.100.0070.03612.13
5.3.90.0060.03612.11
5.3.80.0110.03212.09
5.3.70.0030.03812.09
5.3.60.0040.03712.08
5.3.50.0040.03712.02
5.3.40.0030.03912.03
5.3.30.0080.03211.98
5.3.20.0060.03511.77
5.3.10.0080.03211.73
5.3.00.0060.03611.71
5.2.170.0030.0319.22
5.2.160.0060.0289.22
5.2.150.0040.0319.22
5.2.140.0070.0289.22
5.2.130.0040.0319.18
5.2.120.0030.0309.18
5.2.110.0030.0319.19
5.2.100.0030.0309.18
5.2.90.0040.0299.18
5.2.80.0050.0309.18
5.2.70.0050.0309.18
5.2.60.0060.0299.13
5.2.50.0040.0309.10
5.2.40.0040.0289.07
5.2.30.0070.0269.05
5.2.20.0050.0289.04
5.2.10.0070.0268.94
5.2.00.0040.0298.81
5.1.60.0040.0248.09
5.1.50.0040.0248.08
5.1.40.0040.0238.07
5.1.30.0050.0258.42
5.1.20.0040.0268.44
5.1.10.0040.0258.16
5.1.00.0020.0268.17
5.0.50.0030.0206.64
5.0.40.0030.0196.50
5.0.30.0040.0306.32
5.0.20.0050.0226.28
5.0.10.0040.0216.27
5.0.00.0020.0326.26
4.4.90.0040.0144.78
4.4.80.0020.0164.75
4.4.70.0040.0144.75
4.4.60.0020.0154.76
4.4.50.0040.0144.77
4.4.40.0020.0254.71
4.4.30.0050.0134.76
4.4.20.0030.0154.84
4.4.10.0030.0154.85
4.4.00.0040.0244.76
4.3.110.0030.0204.67
4.3.100.0000.0184.66
4.3.90.0030.0144.63
4.3.80.0020.0254.59
4.3.70.0020.0154.63
4.3.60.0030.0164.63
4.3.50.0030.0164.63
4.3.40.0040.0234.54
4.3.30.0010.0183.30
4.3.20.0020.0173.29
4.3.10.0010.0163.24
4.3.00.0000.0237.50

preferences:
52.07 ms | 401 KiB | 5 Q