1--TEST--
2file() with a range of integer flag values
3--FILE--
4<?php
5
6$filepath = __FILE__ . ".tmp";
7$fd = fopen($filepath, "w+");
8fwrite($fd, "Line 1\nLine 2\nLine 3");
9fclose($fd);
10
11for ($flags = 0; $flags <= 32; $flags++) {
12	var_dump(file($filepath, $flags));
13}
14
15unlink($filepath);
16
17?>
18--EXPECTF--
19array(3) {
20  [0]=>
21  string(7) "Line 1
22"
23  [1]=>
24  string(7) "Line 2
25"
26  [2]=>
27  string(6) "Line 3"
28}
29array(3) {
30  [0]=>
31  string(7) "Line 1
32"
33  [1]=>
34  string(7) "Line 2
35"
36  [2]=>
37  string(6) "Line 3"
38}
39array(3) {
40  [0]=>
41  string(6) "Line 1"
42  [1]=>
43  string(6) "Line 2"
44  [2]=>
45  string(6) "Line 3"
46}
47array(3) {
48  [0]=>
49  string(6) "Line 1"
50  [1]=>
51  string(6) "Line 2"
52  [2]=>
53  string(6) "Line 3"
54}
55array(3) {
56  [0]=>
57  string(7) "Line 1
58"
59  [1]=>
60  string(7) "Line 2
61"
62  [2]=>
63  string(6) "Line 3"
64}
65array(3) {
66  [0]=>
67  string(7) "Line 1
68"
69  [1]=>
70  string(7) "Line 2
71"
72  [2]=>
73  string(6) "Line 3"
74}
75array(3) {
76  [0]=>
77  string(6) "Line 1"
78  [1]=>
79  string(6) "Line 2"
80  [2]=>
81  string(6) "Line 3"
82}
83array(3) {
84  [0]=>
85  string(6) "Line 1"
86  [1]=>
87  string(6) "Line 2"
88  [2]=>
89  string(6) "Line 3"
90}
91array(3) {
92  [0]=>
93  string(7) "Line 1
94"
95  [1]=>
96  string(7) "Line 2
97"
98  [2]=>
99  string(6) "Line 3"
100}
101array(3) {
102  [0]=>
103  string(7) "Line 1
104"
105  [1]=>
106  string(7) "Line 2
107"
108  [2]=>
109  string(6) "Line 3"
110}
111array(3) {
112  [0]=>
113  string(6) "Line 1"
114  [1]=>
115  string(6) "Line 2"
116  [2]=>
117  string(6) "Line 3"
118}
119array(3) {
120  [0]=>
121  string(6) "Line 1"
122  [1]=>
123  string(6) "Line 2"
124  [2]=>
125  string(6) "Line 3"
126}
127array(3) {
128  [0]=>
129  string(7) "Line 1
130"
131  [1]=>
132  string(7) "Line 2
133"
134  [2]=>
135  string(6) "Line 3"
136}
137array(3) {
138  [0]=>
139  string(7) "Line 1
140"
141  [1]=>
142  string(7) "Line 2
143"
144  [2]=>
145  string(6) "Line 3"
146}
147array(3) {
148  [0]=>
149  string(6) "Line 1"
150  [1]=>
151  string(6) "Line 2"
152  [2]=>
153  string(6) "Line 3"
154}
155array(3) {
156  [0]=>
157  string(6) "Line 1"
158  [1]=>
159  string(6) "Line 2"
160  [2]=>
161  string(6) "Line 3"
162}
163array(3) {
164  [0]=>
165  string(7) "Line 1
166"
167  [1]=>
168  string(7) "Line 2
169"
170  [2]=>
171  string(6) "Line 3"
172}
173array(3) {
174  [0]=>
175  string(7) "Line 1
176"
177  [1]=>
178  string(7) "Line 2
179"
180  [2]=>
181  string(6) "Line 3"
182}
183array(3) {
184  [0]=>
185  string(6) "Line 1"
186  [1]=>
187  string(6) "Line 2"
188  [2]=>
189  string(6) "Line 3"
190}
191array(3) {
192  [0]=>
193  string(6) "Line 1"
194  [1]=>
195  string(6) "Line 2"
196  [2]=>
197  string(6) "Line 3"
198}
199array(3) {
200  [0]=>
201  string(7) "Line 1
202"
203  [1]=>
204  string(7) "Line 2
205"
206  [2]=>
207  string(6) "Line 3"
208}
209array(3) {
210  [0]=>
211  string(7) "Line 1
212"
213  [1]=>
214  string(7) "Line 2
215"
216  [2]=>
217  string(6) "Line 3"
218}
219array(3) {
220  [0]=>
221  string(6) "Line 1"
222  [1]=>
223  string(6) "Line 2"
224  [2]=>
225  string(6) "Line 3"
226}
227array(3) {
228  [0]=>
229  string(6) "Line 1"
230  [1]=>
231  string(6) "Line 2"
232  [2]=>
233  string(6) "Line 3"
234}
235
236Warning: file(): '24' flag is not supported in %s on line %d
237bool(false)
238
239Warning: file(): '25' flag is not supported in %s on line %d
240bool(false)
241
242Warning: file(): '26' flag is not supported in %s on line %d
243bool(false)
244
245Warning: file(): '27' flag is not supported in %s on line %d
246bool(false)
247
248Warning: file(): '28' flag is not supported in %s on line %d
249bool(false)
250
251Warning: file(): '29' flag is not supported in %s on line %d
252bool(false)
253
254Warning: file(): '30' flag is not supported in %s on line %d
255bool(false)
256
257Warning: file(): '31' flag is not supported in %s on line %d
258bool(false)
259
260Warning: file(): '32' flag is not supported in %s on line %d
261bool(false)
262