1--TEST--
2rfc1867 max_file_uploads - empty files shouldn't count (debug version)
3--SKIPIF--
4<?php if(!function_exists("leak")) print "skip only for debug builds"; ?>
5--INI--
6file_uploads=1
7error_reporting=E_ALL
8max_file_uploads=1
9--POST_RAW--
10Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
11-----------------------------20896060251896012921717172737
12Content-Disposition: form-data; name="file2"; filename=""
13Content-Type: text/plain-file
14
15
16-----------------------------20896060251896012921717172737
17Content-Disposition: form-data; name="file3"; filename=""
18Content-Type: text/plain-file
19
2033
21-----------------------------20896060251896012921717172737
22Content-Disposition: form-data; name="file4"; filename="file4.txt"
23Content-Type: text/plain-file
24
25
26-----------------------------20896060251896012921717172737
27Content-Disposition: form-data; name="file1"; filename="file1.txt"
28Content-Type: text/plain-file
29
301
31-----------------------------20896060251896012921717172737--
32--FILE--
33<?php
34var_dump($_FILES);
35var_dump($_POST);
36if (is_uploaded_file($_FILES["file1"]["tmp_name"])) {
37	var_dump(file_get_contents($_FILES["file1"]["tmp_name"]));
38}
39?>
40--EXPECTF--
41Notice: No file uploaded in Unknown on line 0
42
43Notice: No file uploaded in Unknown on line 0
44
45Warning: Uploaded file size 0 - file [file4=file4.txt] not saved in Unknown on line 0
46array(4) {
47  ["file2"]=>
48  array(5) {
49    ["name"]=>
50    string(0) ""
51    ["type"]=>
52    string(0) ""
53    ["tmp_name"]=>
54    string(0) ""
55    ["error"]=>
56    int(4)
57    ["size"]=>
58    int(0)
59  }
60  ["file3"]=>
61  array(5) {
62    ["name"]=>
63    string(0) ""
64    ["type"]=>
65    string(0) ""
66    ["tmp_name"]=>
67    string(0) ""
68    ["error"]=>
69    int(4)
70    ["size"]=>
71    int(0)
72  }
73  ["file4"]=>
74  array(5) {
75    ["name"]=>
76    string(9) "file4.txt"
77    ["type"]=>
78    string(0) ""
79    ["tmp_name"]=>
80    string(0) ""
81    ["error"]=>
82    int(5)
83    ["size"]=>
84    int(0)
85  }
86  ["file1"]=>
87  array(5) {
88    ["name"]=>
89    string(9) "file1.txt"
90    ["type"]=>
91    string(15) "text/plain-file"
92    ["tmp_name"]=>
93    string(%d) "%s"
94    ["error"]=>
95    int(0)
96    ["size"]=>
97    int(1)
98  }
99}
100array(0) {
101}
102string(1) "1"
103