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.0000.01518.30
8.3.50.0100.00921.02
8.3.40.0150.00018.85
8.3.30.0100.00319.02
8.3.20.0000.00820.38
8.3.10.0080.00021.70
8.3.00.0050.00319.38
8.2.180.0160.00316.50
8.2.170.0040.01122.96
8.2.160.0100.00720.39
8.2.150.0000.00824.18
8.2.140.0030.00524.66
8.2.130.0070.00326.16
8.2.120.0040.00422.05
8.2.110.0030.00622.13
8.2.100.0090.00317.91
8.2.90.0040.00419.17
8.2.80.0060.00317.97
8.2.70.0040.00417.38
8.2.60.0040.00718.03
8.2.50.0030.00618.07
8.2.40.0060.00319.95
8.2.30.0000.00718.01
8.2.20.0000.00717.74
8.2.10.0030.00518.00
8.2.00.0060.00317.65
8.1.280.0120.00925.92
8.1.270.0080.00022.20
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0040.00723.78
8.1.230.0070.00320.91
8.1.220.0080.00017.77
8.1.210.0080.00018.77
8.1.200.0030.00617.22
8.1.190.0000.00817.25
8.1.180.0000.00718.10
8.1.170.0030.00618.40
8.1.160.0000.00821.97
8.1.150.0060.00318.89
8.1.140.0060.00317.33
8.1.130.0030.00317.82
8.1.120.0000.00817.48
8.1.110.0080.00017.48
8.1.100.0000.00717.39
8.1.90.0040.00417.40
8.1.80.0040.00417.44
8.1.70.0000.00717.35
8.1.60.0030.00517.63
8.1.50.0000.00917.51
8.1.40.0000.00817.50
8.1.30.0080.00017.65
8.1.20.0040.00417.56
8.1.10.0000.00817.45
8.1.00.0020.00517.45
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0040.00418.44
8.0.270.0040.00417.17
8.0.260.0030.00317.27
8.0.250.0000.00716.85
8.0.240.0040.00416.94
8.0.230.0070.00016.98
8.0.220.0060.00316.94
8.0.210.0070.00016.93
8.0.200.0000.00716.99
8.0.190.0070.00416.95
8.0.180.0050.00216.87
8.0.170.0060.00316.80
8.0.160.0030.00316.93
8.0.150.0070.00016.85
8.0.140.0000.00716.79
8.0.130.0000.00613.33
8.0.120.0050.00316.89
8.0.110.0040.00416.79
8.0.100.0080.00016.77
8.0.90.0000.00716.79
8.0.80.0060.00916.87
8.0.70.0040.00416.69
8.0.60.0000.00816.92
8.0.50.0000.00716.76
8.0.30.0180.00517.16
8.0.20.0070.01217.40
8.0.10.0000.00717.04
8.0.00.0130.00816.75
7.4.330.0050.00015.00
7.4.320.0030.00316.59
7.4.300.0000.00616.67
7.4.290.0030.00316.46
7.4.280.0030.00316.51
7.4.270.0030.00316.43
7.4.260.0030.00716.40
7.4.250.0000.00816.48
7.4.240.0000.00716.62
7.4.230.0040.00416.64
7.4.220.0200.00016.65
7.4.210.0040.01116.65
7.4.200.0000.00816.59
7.4.160.0120.00416.39
7.4.150.0090.00917.40
7.4.140.0080.01117.86
7.4.130.0070.01216.56
7.4.120.0110.00716.55
7.4.110.0110.00716.49
7.4.100.0030.01516.43
7.4.90.0060.01016.63
7.4.80.0170.00019.39
7.4.70.0050.01216.46
7.4.60.0070.01816.45
7.4.50.0060.00316.47
7.4.40.0070.01116.49
7.4.30.0100.00816.41
7.4.00.0100.00615.11
7.3.330.0000.00613.31
7.3.320.0060.00013.37
7.3.310.0000.00716.27
7.3.300.0040.00416.39
7.3.290.0090.00616.43
7.3.280.0030.01316.36
7.3.270.0060.01217.40
7.3.260.0170.00616.38
7.3.250.0080.00916.51
7.3.240.0100.01316.45
7.3.230.0140.00716.55
7.3.210.0030.01416.48
7.3.200.0100.01319.39
7.3.190.0060.01116.47
7.3.180.0140.00816.37
7.3.170.0130.00316.48
7.3.160.0070.01516.35
7.3.00.0070.00716.28
7.2.330.0140.00316.68
7.2.320.0120.00416.94
7.2.310.0230.00016.70
7.2.300.0110.00616.59
7.2.290.0090.01516.68
7.2.130.0040.00416.93
7.2.120.0040.01116.60
7.2.110.0090.00616.78
7.2.100.0110.00416.89
7.2.90.0030.01016.64
7.2.80.0030.00716.94
7.2.70.0100.00316.95
7.2.60.0080.00616.95
7.2.50.0110.00417.05
7.2.40.0060.00616.85
7.2.30.0000.01317.11
7.2.20.0100.00717.14
7.2.10.0070.00716.92
7.2.00.0050.00718.26
7.1.250.0070.00715.75
7.1.240.0060.00915.57
7.1.230.0070.00315.66
7.1.220.0090.00615.50
7.1.210.0110.00715.85
7.1.200.0110.00415.69
7.1.190.0090.00615.96
7.1.180.0090.00615.88
7.1.170.0100.00715.97
7.1.160.0100.01015.68
7.1.150.0000.01515.83
7.1.140.0040.01116.01
7.1.130.0000.00915.93
7.1.120.0120.00915.73
7.1.110.0120.00315.70
7.1.100.0080.00317.01
7.1.90.0030.00615.61
7.1.80.0040.01115.54
7.1.70.0050.00516.39
7.1.60.0090.00917.30
7.1.50.0120.00925.41
7.1.40.0090.00615.85
7.1.30.0030.01315.57
7.1.20.0130.00715.85
7.1.10.0030.01015.79
7.1.00.0040.04019.09
7.0.330.0030.00915.21
7.0.320.0060.00615.30
7.0.310.0060.00615.41
7.0.300.0000.01315.61
7.0.290.0060.00615.15
7.0.280.0100.00015.46
7.0.270.0000.01215.14
7.0.260.0100.00315.48
7.0.250.0040.00815.48
7.0.240.0040.00815.53
7.0.230.0080.00315.48
7.0.220.0060.00915.37
7.0.210.0030.00615.56
7.0.200.0050.00616.19
7.0.190.0070.00715.18
7.0.180.0090.00615.30
7.0.170.0030.00715.30
7.0.160.0100.00715.46
7.0.150.0000.01415.47
7.0.140.0070.04018.83
7.0.130.0080.00815.54
7.0.120.0000.01215.55
7.0.110.0000.00815.39
7.0.100.0140.00315.35
7.0.90.0000.00815.65
7.0.80.0240.00015.46
7.0.70.0040.01115.72
7.0.60.0060.03617.67
7.0.50.0080.04316.64
7.0.40.0120.03116.73
7.0.30.0250.03116.85
7.0.20.0150.04516.74
7.0.10.0060.04616.74
7.0.00.0080.04416.66
5.6.380.0110.00714.88
5.6.370.0130.00314.39
5.6.360.0070.00314.39
5.6.350.0000.01314.04
5.6.340.0040.00814.13
5.6.330.0000.01214.36
5.6.320.0060.00914.78
5.6.310.0080.00414.21
5.6.300.0070.01014.33
5.6.290.0060.00914.24
5.6.280.0050.04017.67
5.6.270.0070.01014.30
5.6.260.0060.01014.57
5.6.250.0040.01114.46
5.6.240.0060.00614.55
5.6.230.0040.01114.36
5.6.220.0110.00414.43
5.6.210.0040.04217.51
5.6.200.0050.04516.19
5.6.190.0070.02317.46
5.6.180.0210.03817.65
5.6.170.0170.04517.41
5.6.160.0100.04517.54
5.6.150.0140.03516.44
5.6.140.0130.04116.16
5.6.130.0020.04416.16
5.6.120.0050.02317.71
5.6.110.0030.04017.63
5.6.100.0090.03317.84
5.6.90.0110.02317.75
5.6.80.0080.02817.37
5.6.70.0100.01014.46
5.6.60.0170.00014.41
5.6.50.0140.01014.18
5.6.40.0100.01014.33
5.6.30.0130.01014.39
5.6.20.0070.01114.35
5.6.10.0160.00314.35
5.6.00.0110.00414.28
5.5.380.0050.00511.42
5.5.370.0030.00611.36
5.5.360.0120.00410.87
5.5.350.0090.04215.84
5.5.340.0110.01714.74
5.5.330.0070.04215.73
5.5.320.0200.02915.71
5.5.310.0080.04415.76
5.5.300.0070.04314.73
5.5.290.0050.02714.75
5.5.280.0050.04415.84
5.5.270.0050.02316.14
5.5.260.0150.04216.04
5.5.250.0050.03815.78
5.5.240.0140.04015.55
5.5.230.0110.00311.24
5.5.220.0000.01111.33
5.5.210.0150.00411.36
5.5.200.0170.00611.09
5.5.190.0130.00710.99
5.5.180.0110.00811.20
5.5.170.0120.00310.98
5.5.160.0090.00311.07
5.5.150.0120.01210.95
5.5.140.0050.00811.07
5.5.130.0140.00411.27
5.5.120.0030.00811.31
5.5.110.0030.00511.27
5.5.100.0060.00511.14
5.5.90.0000.01011.37
5.5.80.0070.00710.97
5.5.70.0100.00511.15
5.5.60.0110.00311.35
5.5.50.0170.00011.16
5.5.40.0030.00711.04
5.5.30.0060.00611.10
5.5.20.0040.00411.22
5.5.10.0080.00210.96
5.5.00.0130.01010.75
5.4.450.0080.03015.29
5.4.440.0520.04015.27
5.4.430.0510.03715.29
5.4.420.0360.00215.24
5.4.410.0350.00315.43
5.4.400.0300.00514.95
5.4.390.0340.00115.02
5.4.380.0330.00315.11
5.4.370.0380.00214.99
5.4.360.0390.00115.28
5.4.350.0520.00015.11
5.4.340.0130.02011.63
5.4.330.0160.00411.07
5.4.320.0100.02111.84
5.4.310.0080.02611.80
5.4.300.0100.02411.64
5.4.290.0040.02411.79
5.4.280.0080.01811.55
5.4.270.0060.02011.81
5.4.260.0050.02311.73
5.4.250.0040.02511.87
5.4.240.0050.02311.79
5.4.230.0050.02311.92
5.4.220.0070.01911.71
5.4.210.0110.02211.78
5.4.200.0080.02311.74
5.4.190.0090.01711.80
5.4.180.0070.02211.66
5.4.170.0110.02311.65
5.4.160.0080.01811.79
5.4.150.0060.02111.66
5.4.140.0070.02311.67
5.4.130.0080.01911.61
5.4.120.0060.02111.42
5.4.110.0050.02011.58
5.4.100.0040.02311.58
5.4.90.0050.01911.47
5.4.80.0060.02211.66
5.4.70.0040.02311.65
5.4.60.0070.01811.62
5.4.50.0050.02111.56
5.4.40.0080.01611.61
5.4.30.0080.02111.46
5.4.20.0060.01811.62
5.4.10.0090.01711.60
5.4.00.0030.02311.21
5.3.290.0110.02011.57
5.3.280.0050.02111.50
5.3.270.0090.02311.38
5.3.260.0030.02511.57
5.3.250.0070.01911.53
5.3.240.0040.02111.44
5.3.230.0090.02011.53
5.3.220.0050.02111.48
5.3.210.0050.02311.47
5.3.200.0030.02411.45
5.3.190.0060.02011.51
5.3.180.0030.02111.56
5.3.170.0020.02411.48
5.3.160.0040.02611.49
5.3.150.0050.02411.45
5.3.140.0040.02911.53
5.3.130.0040.02111.52
5.3.120.0050.02411.54
5.3.110.0020.02411.40
5.3.100.0100.02111.23
5.3.90.0050.02411.29
5.3.80.0050.02211.05
5.3.70.0030.02311.26
5.3.60.0060.01811.09
5.3.50.0100.02211.13
5.3.40.0030.02411.15
5.3.30.0050.01911.12
5.3.20.0090.02311.00
5.3.10.0070.01810.88
5.3.00.0050.02010.78
5.2.170.0060.0189.17
5.2.160.0060.0189.13
5.2.150.0060.0189.21
5.2.140.0030.0209.11
5.2.130.0050.0199.10
5.2.120.0040.0179.24
5.2.110.0080.0149.10
5.2.100.0050.0169.13
5.2.90.0060.0149.23
5.2.80.0040.0179.27
5.2.70.0040.0179.23
5.2.60.0040.0179.04
5.2.50.0060.0189.18
5.2.40.0040.0179.12
5.2.30.0070.0169.13
5.2.20.0060.0188.98
5.2.10.0060.0208.84
5.2.00.0070.0178.90
5.1.60.0010.0168.21
5.1.50.0070.0168.27
5.1.40.0020.0178.20
5.1.30.0040.0178.50
5.1.20.0070.0138.46
5.1.10.0050.0138.29
5.1.00.0030.0158.24
5.0.50.0020.0127.49
5.0.40.0050.0117.42
5.0.30.0050.0167.32
5.0.20.0010.0157.30
5.0.10.0040.0157.30
5.0.00.0020.0187.29
4.4.90.0060.0076.55
4.4.80.0020.0126.54
4.4.70.0020.0106.54
4.4.60.0020.0096.54
4.4.50.0020.0096.55
4.4.40.0020.0146.52
4.4.30.0030.0106.54
4.4.20.0020.0096.59
4.4.10.0020.0136.59
4.4.00.0050.0126.54
4.3.110.0040.0096.50
4.3.100.0020.0106.49
4.3.90.0050.0096.48
4.3.80.0040.0156.46
4.3.70.0040.0086.48
4.3.60.0020.0096.48
4.3.50.0010.0116.48
4.3.40.0010.0166.43
4.3.30.0010.0115.82
4.3.20.0040.0085.81
4.3.10.0050.0075.79
4.3.00.0050.0157.76

preferences:
43 ms | 401 KiB | 5 Q