1--TEST--
2import_request_variables() test (overwrite super-globals)
3--SKIPIF--
4<?php if(PHP_VERSION_ID >= 50399){ die('skip not needed anymore without register_globals'); } ?>
5--GET--
6GET=0&POST=1&COOKIE=2&FILES=3&REQUEST=4
7--POST--
8GET=5&POST=6&COOKIE=7&FILES=8&REQUEST=9
9--COOKIE--
10GET=10;POST=11;COOKIE=12;FILES=13;REQUEST=14
11--INI--
12variables_order=CGP
13--FILE--
14<?php
15
16import_request_variables("gpc", "_");
17var_dump($_GET, $_POST, $_COOKIE, $_FILES, $_REQUEST);
18
19echo "Done\n";
20?>
21--EXPECTF--
22Warning: import_request_variables(): Attempted super-global (_GET) variable overwrite in %s on line %d
23
24Warning: import_request_variables(): Attempted super-global (_POST) variable overwrite in %s on line %d
25
26Warning: import_request_variables(): Attempted super-global (_COOKIE) variable overwrite in %s on line %d
27
28Warning: import_request_variables(): Attempted super-global (_FILES) variable overwrite in %s on line %d
29
30Warning: import_request_variables(): Attempted super-global (_REQUEST) variable overwrite in %s on line %d
31
32Warning: import_request_variables(): Attempted super-global (_GET) variable overwrite in %s on line %d
33
34Warning: import_request_variables(): Attempted super-global (_POST) variable overwrite in %s on line %d
35
36Warning: import_request_variables(): Attempted super-global (_COOKIE) variable overwrite in %s on line %d
37
38Warning: import_request_variables(): Attempted super-global (_FILES) variable overwrite in %s on line %d
39
40Warning: import_request_variables(): Attempted super-global (_REQUEST) variable overwrite in %s on line %d
41
42Warning: import_request_variables(): Attempted super-global (_GET) variable overwrite in %s on line %d
43
44Warning: import_request_variables(): Attempted super-global (_POST) variable overwrite in %s on line %d
45
46Warning: import_request_variables(): Attempted super-global (_COOKIE) variable overwrite in %s on line %d
47
48Warning: import_request_variables(): Attempted super-global (_FILES) variable overwrite in %s on line %d
49
50Warning: import_request_variables(): Attempted super-global (_REQUEST) variable overwrite in %s on line %d
51array(5) {
52  ["GET"]=>
53  string(1) "0"
54  ["POST"]=>
55  string(1) "1"
56  ["COOKIE"]=>
57  string(1) "2"
58  ["FILES"]=>
59  string(1) "3"
60  ["REQUEST"]=>
61  string(1) "4"
62}
63array(5) {
64  ["GET"]=>
65  string(1) "5"
66  ["POST"]=>
67  string(1) "6"
68  ["COOKIE"]=>
69  string(1) "7"
70  ["FILES"]=>
71  string(1) "8"
72  ["REQUEST"]=>
73  string(1) "9"
74}
75array(5) {
76  ["GET"]=>
77  string(2) "10"
78  ["POST"]=>
79  string(2) "11"
80  ["COOKIE"]=>
81  string(2) "12"
82  ["FILES"]=>
83  string(2) "13"
84  ["REQUEST"]=>
85  string(2) "14"
86}
87array(0) {
88}
89array(5) {
90  ["GET"]=>
91  string(1) "5"
92  ["POST"]=>
93  string(1) "6"
94  ["COOKIE"]=>
95  string(1) "7"
96  ["FILES"]=>
97  string(1) "8"
98  ["REQUEST"]=>
99  string(1) "9"
100}
101Done
102