3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [1,2,3,4,5]; $cols = 4; $chunks = array_fill(0, $cols, []); $cnt = 0; foreach ($array as $thing) { $chunks[$cnt++ % $cols][] = $thing; } var_dump($chunks); $chunks = array_chunk($array, $cols); $chunks = array_map(null, ...$chunks); var_dump($chunks);

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.0090.00918.30
8.3.50.0090.01122.11
8.3.40.0190.00318.88
8.3.30.0040.01119.12
8.3.20.0040.00420.34
8.3.10.0040.00421.61
8.3.00.0000.00819.36
8.2.180.0110.00718.17
8.2.170.0040.01122.96
8.2.160.0040.01120.39
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0000.01426.16
8.2.120.0030.00619.77
8.2.110.0110.00020.57
8.2.100.0040.00717.84
8.2.90.0080.00017.84
8.2.80.0080.00017.97
8.2.70.0040.00417.50
8.2.60.0050.00317.93
8.2.50.0050.00318.07
8.2.40.0000.00818.16
8.2.30.0040.00417.98
8.2.20.0030.00517.68
8.2.10.0040.00418.18
8.2.00.0050.00317.70
8.1.280.0080.00825.92
8.1.270.0030.00620.73
8.1.260.0050.00226.35
8.1.250.0080.00028.09
8.1.240.0030.00620.83
8.1.230.0070.00320.88
8.1.220.0060.00317.78
8.1.210.0000.00918.95
8.1.200.0000.00917.25
8.1.190.0080.00017.35
8.1.180.0060.00318.10
8.1.170.0030.00518.71
8.1.160.0000.00819.02
8.1.150.0050.00318.93
8.1.140.0050.00217.50
8.1.130.0040.00417.37
8.1.120.0050.00217.44
8.1.110.0000.00817.48
8.1.100.0040.00417.49
8.1.90.0030.00417.36
8.1.80.0040.00417.36
8.1.70.0040.00417.49
8.1.60.0040.00417.54
8.1.50.0090.00017.50
8.1.40.0040.00417.49
8.1.30.0000.00817.70
8.1.20.0000.00817.63
8.1.10.0000.00817.48
8.1.00.0000.00817.54
8.0.300.0000.00720.04
8.0.290.0040.00416.75
8.0.280.0030.00318.40
8.0.270.0000.00717.26
8.0.260.0040.00416.76
8.0.250.0040.00416.86
8.0.240.0000.00816.83
8.0.230.0030.00316.88
8.0.220.0000.00716.89
8.0.210.0090.00016.78
8.0.200.0000.00716.95
8.0.190.0060.00316.96
8.0.180.0000.00716.93
8.0.170.0000.00816.91
8.0.160.0040.00416.96
8.0.150.0040.00416.73
8.0.140.0000.00716.77
8.0.130.0000.00613.34
8.0.120.0040.00416.75
8.0.110.0000.00716.83
8.0.100.0000.00716.96
8.0.90.0040.00416.76
8.0.80.0090.01316.95
8.0.70.0000.00817.01
8.0.60.0040.00416.68
8.0.50.0050.00316.76
8.0.30.0080.01217.30
8.0.20.0120.00717.40
8.0.10.0040.00417.06
8.0.00.0110.00716.74
7.4.330.0050.00015.09
7.4.320.0030.00316.60
7.4.300.0000.00616.61
7.4.290.0030.00316.53
7.4.280.0000.00916.48
7.4.270.0000.00716.61
7.4.260.0050.00316.45
7.4.250.0040.00416.58
7.4.240.0030.00616.48
7.4.230.0040.00416.58
7.4.220.0030.01516.61
7.4.210.0090.00516.38
7.4.200.0000.00716.63
7.4.160.0120.00916.43
7.4.150.0120.00617.40
7.4.140.0110.00717.86
7.4.130.0120.00816.62
7.4.120.0100.00916.53
7.4.110.0090.00916.50
7.4.100.0110.00616.66
7.4.90.0060.01216.53
7.4.80.0190.00019.39
7.4.70.0070.01116.37
7.4.60.0070.01016.39
7.4.50.0060.00316.57
7.4.40.0060.01316.42
7.4.30.0060.01316.59
7.4.00.0070.00614.79
7.3.330.0000.00713.23
7.3.320.0090.00913.09
7.3.310.0070.00016.19
7.3.300.0000.00716.26
7.3.290.0090.00916.30
7.3.280.0120.00916.31
7.3.270.0100.01317.40
7.3.260.0070.01316.42
7.3.250.0140.00716.29
7.3.240.0090.00916.17
7.3.230.0210.00316.58
7.3.210.0150.00316.61
7.3.200.0060.01219.39
7.3.190.0160.00016.38
7.3.180.0060.00916.18
7.3.170.0100.00816.59
7.3.160.0070.01016.52
7.3.120.0040.00714.84
7.3.110.0030.01014.93
7.3.100.0000.01114.79
7.3.90.0030.00714.83
7.3.80.0060.00314.77
7.3.70.0040.01114.84
7.3.60.0000.00914.94
7.3.50.0050.00514.99
7.3.40.0130.00014.90
7.3.30.0030.00814.73
7.3.20.0040.00716.63
7.3.10.0110.00316.61
7.3.00.0050.00516.65
7.2.330.0040.01516.69
7.2.320.0140.00316.41
7.2.310.0190.00616.50
7.2.300.0120.01216.75
7.2.290.0100.01016.70
7.2.250.0070.00715.14
7.2.240.0060.01215.05
7.2.230.0030.01015.15
7.2.220.0070.00715.01
7.2.210.0070.01015.01
7.2.200.0030.00715.07
7.2.190.0040.01115.05
7.2.180.0030.00914.93
7.2.170.0080.00315.20
7.2.130.0030.00717.01
7.2.120.0060.00917.04
7.2.110.0040.00816.73
7.2.100.0040.01116.83
7.2.90.0080.00816.92
7.2.80.0110.00516.71
7.2.70.0090.00616.97
7.2.60.0130.01216.82
7.2.50.0030.01017.02
7.2.40.0030.00716.74
7.2.30.0030.01017.09
7.2.20.0040.00816.94
7.2.10.0100.00616.75
7.2.00.0100.00318.24
7.1.330.0100.00315.62
7.1.320.0040.01115.89
7.1.310.0040.00716.04
7.1.300.0030.01015.71
7.1.290.0040.01115.81
7.1.280.0110.00315.78
7.1.270.0060.00315.83
7.1.260.0060.00815.83
7.1.250.0100.00315.75
7.1.200.0000.01115.54
7.1.100.0090.01318.14
7.1.70.0030.00716.86
7.1.60.0100.01419.50
7.1.50.0070.01816.42
7.1.00.0070.07022.54
7.0.200.0040.00416.70
7.0.140.0070.07022.16
7.0.60.0100.08320.01
7.0.50.0070.03717.88
7.0.40.0030.09020.08
7.0.30.0270.07720.21
7.0.20.0300.06720.17
7.0.10.0330.09020.09
7.0.00.0070.04319.99
5.6.280.0100.06320.98
5.6.210.0100.04020.62
5.6.200.0170.07718.08
5.6.190.0030.04720.57
5.6.180.0200.03720.58
5.6.170.0300.06020.62
5.6.160.0070.09020.40
5.6.150.0000.04318.07
5.6.140.0000.04018.21
5.6.130.0100.07718.21
5.6.120.0100.07321.14
5.6.110.0100.07021.01
5.6.100.0070.09021.12
5.6.90.0070.05720.97
5.6.80.0030.07020.42
5.6.70.0200.06720.53
5.5.350.0200.07020.46
5.5.340.0130.07718.03
5.5.330.0030.04320.40
5.5.320.0100.05320.13
5.5.310.0370.07020.23
5.5.300.0070.03718.08
5.5.290.0070.07017.98
5.5.280.0170.07720.64
5.5.270.0030.06320.86
5.5.260.0000.07020.87
5.5.250.0070.06320.61
5.5.240.0130.08020.23
5.4.450.0130.05719.64
5.4.440.0930.04319.61
5.4.430.0700.05319.52
5.4.420.0670.06319.62
5.4.410.0870.06019.18
5.4.400.0170.05318.63
5.4.390.0300.04018.59
5.4.380.0230.05018.72
5.4.370.0130.05718.55
5.4.360.0170.06318.46
5.4.350.0100.06318.66
5.4.340.0270.05018.49
5.4.320.0200.07318.79
5.4.310.0230.04718.46
5.4.300.0170.05018.55
5.4.290.0270.04318.71
5.4.280.0230.05018.41
5.4.270.0230.05318.46
5.4.260.0300.05718.54
5.4.250.0230.07318.68
5.4.240.0170.05318.71
5.4.230.0130.05718.52
5.4.220.0230.05018.45
5.4.210.0230.05318.70
5.4.200.0200.04316.50
5.4.190.0270.06318.76
5.4.180.0300.04718.52
5.4.170.0200.05318.66
5.4.160.0200.04718.75
5.4.150.0270.05018.73
5.4.140.0200.05316.26
5.4.130.0130.05716.19
5.4.120.0170.04716.21
5.4.110.0130.06016.21
5.4.100.0200.05316.19
5.4.90.0170.06016.21
5.4.80.0200.05716.17
5.4.70.0170.05316.18
5.4.60.0170.05016.26
5.4.50.0100.05716.25
5.4.40.0100.05716.40
5.4.30.0270.03716.25
5.4.20.0130.05316.23
5.4.10.0130.05016.26
5.4.00.0100.05315.75
5.3.290.0130.06014.70
5.3.280.0200.04714.56
5.3.270.0100.06014.69
5.3.260.0230.05314.54
5.3.250.0200.04714.63
5.3.240.0300.04314.51
5.3.230.0200.06014.51
5.3.220.0130.05714.52
5.3.210.0130.05714.63
5.3.200.0100.06314.51
5.3.190.3370.05014.63
5.3.180.0070.06014.51
5.3.170.0200.05314.50
5.3.160.0100.06014.52
5.3.150.0270.04314.62
5.3.140.0200.05314.54
5.3.130.0200.06714.46
5.3.120.0170.05714.55
5.3.110.0130.06014.48
5.3.100.0130.05014.01
5.3.90.0200.04713.88
5.3.80.0200.04713.88
5.3.70.0170.06014.00
5.3.60.0200.04713.93
5.3.50.0130.05313.91
5.3.40.0300.05713.97
5.3.30.0170.05013.88
5.3.20.0300.04713.59
5.3.10.0000.06713.59
5.3.00.0170.05013.56
5.2.170.0100.04711.20
5.2.160.0100.04311.17
5.2.150.0100.04711.11
5.2.140.0130.04011.26
5.2.130.0100.04311.13
5.2.120.0130.04011.03
5.2.110.0170.03711.03
5.2.100.0100.04311.07
5.2.90.0100.04711.04
5.2.80.0130.04011.08
5.2.70.0200.04011.12
5.2.60.0170.03711.07
5.2.50.0100.04311.17
5.2.40.0070.04310.91
5.2.30.0070.04311.11
5.2.20.0130.04010.93
5.2.10.0070.04310.87
5.2.00.0070.04310.70
5.1.60.0200.04010.02
5.1.50.0130.04310.00
5.1.40.0200.03010.03
5.1.30.0130.03310.34
5.1.20.0130.05010.44
5.1.10.0100.05010.10
5.1.00.0200.04010.13
5.0.50.0070.0408.57
5.0.40.0100.0378.51
5.0.30.0130.0508.23
5.0.20.0070.0278.29
5.0.10.0100.0278.26
5.0.00.0130.0408.19
4.4.90.0070.0235.91
4.4.80.0030.0305.90
4.4.70.0100.0305.89
4.4.60.0030.0235.91
4.4.50.0100.0205.89
4.4.40.0030.0375.94
4.4.30.0170.0105.87
4.4.20.0070.0235.95
4.4.10.0100.0175.97
4.4.00.0130.0275.89
4.3.110.0100.0175.75
4.3.100.0000.0275.84
4.3.90.0030.0235.82
4.3.80.0030.0375.80
4.3.70.0100.0205.91
4.3.60.0100.0275.87
4.3.50.0130.0235.78
4.3.40.0070.0335.79
4.3.30.0030.0234.71
4.3.20.0030.0274.71
4.3.10.0030.0234.71
4.3.00.0070.0207.19

preferences:
52.75 ms | 401 KiB | 5 Q