3v4l.org

run code in 300+ PHP versions simultaneously
<?php function custom_chunk($array, $maxrows) { $result = []; $size = sizeof($array); $columns = ceil($size / $maxrows); $fullrows = $size - ($columns - 1) * $maxrows; for ($i = 0; $i < $maxrows; ++$i) { $result[] = implode(', ', array_splice($array, 0, ($i < $fullrows ? $columns : $columns - 1))); } return $result; } $data = ['Item 1', 'Item 2', 'Item 3', 'Item 4', 'Item 5', 'Item 6', 'Item 7']; var_export(custom_chunk($data, 3));

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.4.120.0120.00520.54
8.4.110.0110.01020.70
8.4.100.0110.01117.45
8.4.90.0140.00617.69
8.4.80.0100.01017.80
8.4.70.0080.01317.95
8.4.60.0050.00418.97
8.4.50.0100.00718.62
8.4.40.0100.01019.25
8.4.30.0030.00617.83
8.4.20.0100.01020.56
8.4.10.0040.00419.51
8.3.250.0080.01019.01
8.3.240.0120.00716.50
8.3.230.0130.00716.49
8.3.220.0120.00716.85
8.3.210.0030.00418.37
8.3.200.0040.00516.75
8.3.190.0080.00717.25
8.3.180.0100.00716.55
8.3.170.0070.01120.49
8.3.160.0150.00417.26
8.3.150.0150.00617.27
8.3.140.0040.00418.91
8.3.130.0040.00418.36
8.3.120.0110.00018.88
8.3.110.0060.00320.94
8.3.100.0050.00518.56
8.3.90.0040.00416.49
8.3.80.0060.00318.18
8.3.70.0070.00716.75
8.3.60.0070.01518.43
8.3.50.0120.01018.06
8.3.40.0130.00718.97
8.3.30.0130.00318.51
8.3.20.0080.00019.18
8.3.10.0040.00421.75
8.3.00.0080.00020.70
8.2.290.0120.00618.79
8.2.280.0090.00918.37
8.2.270.0070.01017.12
8.2.260.0030.00518.25
8.2.250.0070.01118.33
8.2.240.0060.00316.90
8.2.230.0080.00022.58
8.2.220.0040.01124.06
8.2.210.0000.00826.77
8.2.200.0050.00518.54
8.2.190.0130.00716.58
8.2.180.0120.00916.50
8.2.170.0120.00322.96
8.2.160.0110.00422.30
8.2.150.0070.00024.18
8.2.140.0080.00024.66
8.2.130.0060.00319.95
8.2.120.0140.00026.35
8.2.110.0080.00322.29
8.2.100.0150.00017.97
8.2.90.0000.00918.28
8.2.80.0040.00417.97
8.2.70.0040.00418.05
8.2.60.0040.00418.34
8.2.50.0040.00419.34
8.2.40.0040.00419.60
8.2.30.0000.00719.44
8.2.20.0000.00718.21
8.2.10.0050.00318.20
8.2.00.0030.00617.77
8.1.330.0150.00416.06
8.1.320.0040.00616.23
8.1.310.0150.00416.66
8.1.300.0090.00918.61
8.1.290.0030.00618.88
8.1.280.0070.01025.92
8.1.270.0040.00422.26
8.1.260.0150.00026.35
8.1.250.0070.00028.09
8.1.240.0080.00022.22
8.1.230.0080.00419.08
8.1.220.0050.00317.74
8.1.210.0000.00918.77
8.1.200.0050.00517.38
8.1.190.0080.00017.23
8.1.180.0030.00618.10
8.1.170.0080.00018.64
8.1.160.0040.00419.00
8.1.150.0040.00418.96
8.1.140.0050.00222.16
8.1.130.0030.00320.17
8.1.120.0040.00417.55
8.1.110.0050.00317.51
8.1.100.0030.00617.46
8.1.90.0070.00017.46
8.1.80.0000.00817.41
8.1.70.0030.00317.58
8.1.60.0030.00617.71
8.1.50.0030.00517.65
8.1.40.0040.00417.66
8.1.30.0030.00617.57
8.1.20.0000.01117.72
8.1.10.0040.00417.58
8.1.00.0000.00717.39
8.0.300.0000.00819.73
8.0.290.0080.00016.63
8.0.280.0030.00318.48
8.0.270.0070.00016.90
8.0.260.0030.00318.52
8.0.250.0000.00716.95
8.0.240.0040.00417.05
8.0.230.0070.00017.04
8.0.220.0000.00716.98
8.0.210.0000.00716.97
8.0.200.0000.00817.01
8.0.190.0040.00417.02
8.0.180.0000.00816.81
8.0.170.0030.00616.99
8.0.160.0000.00817.01
8.0.150.0040.00416.88
8.0.140.0000.00716.79
8.0.130.0050.00013.31
8.0.120.0050.00316.84
8.0.110.0000.00816.91
8.0.100.0040.00416.85
8.0.90.0000.00717.02
8.0.80.0110.00916.96
8.0.70.0000.00717.05
8.0.60.0070.00016.84
8.0.50.0030.00716.96
8.0.30.0080.01317.22
8.0.20.0100.01517.40
8.0.10.0040.00416.93
8.0.00.0110.00816.83
7.4.330.0050.00015.55
7.4.320.0040.00416.50
7.4.300.0050.00316.63
7.4.290.0050.00216.51
7.4.280.0000.00716.61
7.4.270.0000.00716.67
7.4.260.0000.00716.61
7.4.250.0070.00016.50
7.4.240.0000.00716.58
7.4.230.0070.00016.75
7.4.220.0070.00016.66
7.4.210.0060.01016.70
7.4.200.0070.00016.58
7.4.140.0080.00817.86
7.4.130.0160.00316.66
7.4.120.0090.00916.57
7.4.110.0140.00316.56
7.4.100.0110.00816.57
7.4.90.0090.01016.48
7.4.80.0060.00919.39
7.4.70.0100.01316.45
7.4.60.0100.00716.59
7.4.50.0000.01516.45
7.4.40.0080.00916.82
7.4.00.0110.00715.07
7.3.330.0000.00513.26
7.3.320.0000.00513.39
7.3.310.0040.00416.46
7.3.300.0050.00216.30
7.3.290.0070.00016.48
7.3.280.0000.01716.35
7.3.260.0090.00916.52
7.3.240.0110.00616.48
7.3.230.0080.00816.47
7.3.210.0110.00616.67
7.3.200.0140.00316.54
7.3.190.0090.01216.75
7.3.180.0070.01316.52
7.3.170.0140.00716.57
7.3.160.0060.00916.45
7.2.330.0120.00616.85
7.2.320.0060.01016.43
7.2.310.0060.01016.46
7.2.300.0060.01016.79
7.2.290.0070.01116.42
7.2.110.0860.01014.61
7.2.100.1140.01014.79
7.2.90.0910.00714.83
7.2.80.0870.00614.79
7.2.70.1070.00715.01
7.2.60.0700.00614.73
7.2.50.1030.01015.02
7.2.40.1220.00315.01
7.2.30.0950.01314.88
7.2.20.0680.00615.05
7.2.10.0690.00315.00
7.2.00.0830.00314.64
7.1.230.1030.01013.64
7.1.220.0780.01013.79
7.1.210.0630.01013.91
7.1.200.0760.00313.60
7.1.190.0630.00713.66
7.1.180.1520.00013.88
7.1.170.0930.00713.71
7.1.160.0950.00713.77
7.1.150.1170.01313.89
7.1.140.0860.01413.91
7.1.130.0840.00713.89
7.1.120.0580.00314.06
7.1.110.0650.00713.88
7.1.100.0540.00614.03
7.1.90.0590.00713.25
7.1.80.0600.00313.64
7.1.70.0660.00314.08
7.1.60.0840.00331.64
7.1.50.0800.01031.99
7.1.40.1420.01631.68
7.1.30.0950.01431.88
7.1.20.0780.00631.96
7.1.10.0550.01014.03
7.1.00.0680.00713.89
5.6.380.0100.00813.83

preferences:
29.75 ms | 403 KiB | 5 Q