1--TEST--
2basic array_chunk test
3--FILE--
4<?php
5$input_array = array('a', 'b', 'c', 'd', 'e');
6var_dump(array_chunk($input_array, 0));
7var_dump(array_chunk($input_array, 0, true));
8var_dump(array_chunk($input_array, 1));
9var_dump(array_chunk($input_array, 1, true));
10var_dump(array_chunk($input_array, 2));
11var_dump(array_chunk($input_array, 2, true));
12var_dump(array_chunk($input_array, 10));
13var_dump(array_chunk($input_array, 10, true));
14?>
15--EXPECTF--
16Warning: array_chunk(): Size parameter expected to be greater than 0 in %s on line %d
17NULL
18
19Warning: array_chunk(): Size parameter expected to be greater than 0 in %s on line %d
20NULL
21array(5) {
22  [0]=>
23  array(1) {
24    [0]=>
25    string(1) "a"
26  }
27  [1]=>
28  array(1) {
29    [0]=>
30    string(1) "b"
31  }
32  [2]=>
33  array(1) {
34    [0]=>
35    string(1) "c"
36  }
37  [3]=>
38  array(1) {
39    [0]=>
40    string(1) "d"
41  }
42  [4]=>
43  array(1) {
44    [0]=>
45    string(1) "e"
46  }
47}
48array(5) {
49  [0]=>
50  array(1) {
51    [0]=>
52    string(1) "a"
53  }
54  [1]=>
55  array(1) {
56    [1]=>
57    string(1) "b"
58  }
59  [2]=>
60  array(1) {
61    [2]=>
62    string(1) "c"
63  }
64  [3]=>
65  array(1) {
66    [3]=>
67    string(1) "d"
68  }
69  [4]=>
70  array(1) {
71    [4]=>
72    string(1) "e"
73  }
74}
75array(3) {
76  [0]=>
77  array(2) {
78    [0]=>
79    string(1) "a"
80    [1]=>
81    string(1) "b"
82  }
83  [1]=>
84  array(2) {
85    [0]=>
86    string(1) "c"
87    [1]=>
88    string(1) "d"
89  }
90  [2]=>
91  array(1) {
92    [0]=>
93    string(1) "e"
94  }
95}
96array(3) {
97  [0]=>
98  array(2) {
99    [0]=>
100    string(1) "a"
101    [1]=>
102    string(1) "b"
103  }
104  [1]=>
105  array(2) {
106    [2]=>
107    string(1) "c"
108    [3]=>
109    string(1) "d"
110  }
111  [2]=>
112  array(1) {
113    [4]=>
114    string(1) "e"
115  }
116}
117array(1) {
118  [0]=>
119  array(5) {
120    [0]=>
121    string(1) "a"
122    [1]=>
123    string(1) "b"
124    [2]=>
125    string(1) "c"
126    [3]=>
127    string(1) "d"
128    [4]=>
129    string(1) "e"
130  }
131}
132array(1) {
133  [0]=>
134  array(5) {
135    [0]=>
136    string(1) "a"
137    [1]=>
138    string(1) "b"
139    [2]=>
140    string(1) "c"
141    [3]=>
142    string(1) "d"
143    [4]=>
144    string(1) "e"
145  }
146}
147