1--TEST--
2import_request_variables() tests
3--SKIPIF--
4<?php if(PHP_VERSION_ID >= 50399){ die('skip not needed anymore without register_globals'); } ?>
5--GET--
6a=1&b=heh&c=3&d[]=5&GLOBALS=test&1=hm
7--POST--
8ap=25&bp=test&cp=blah3&dp[]=ar
9--FILE--
10<?php
11
12var_dump(import_request_variables());
13var_dump(import_request_variables(""));
14var_dump(import_request_variables("", ""));
15
16var_dump(import_request_variables("g", ""));
17var_dump($a, $b, $c, $ap);
18
19var_dump(import_request_variables("g", "g_"));
20var_dump($g_a, $g_b, $g_c, $g_ap, $g_1);
21
22var_dump(import_request_variables("GP", "i_"));
23var_dump($i_a, $i_b, $i_c, $i_ap, $i_bp, $i_cp, $i_dp);
24
25var_dump(import_request_variables("gGg", "r_"));
26var_dump($r_a, $r_b, $r_c, $r_ap);
27
28echo "Done\n";
29?>
30--EXPECTF--
31Warning: import_request_variables() expects at least 1 parameter, 0 given in %s on line %d
32NULL
33bool(false)
34
35Notice: import_request_variables(): No prefix specified - possible security hazard in %s on line %d
36bool(false)
37
38Notice: import_request_variables(): No prefix specified - possible security hazard in %s on line %d
39
40Warning: import_request_variables(): Attempted GLOBALS variable overwrite in %s on line %d
41
42Warning: import_request_variables(): Numeric key detected - possible security hazard in %s on line %d
43bool(true)
44
45Notice: Undefined variable: ap in %s on line %d
46string(1) "1"
47string(3) "heh"
48string(1) "3"
49NULL
50bool(true)
51
52Notice: Undefined variable: g_ap in %s on line %d
53string(1) "1"
54string(3) "heh"
55string(1) "3"
56NULL
57string(2) "hm"
58bool(true)
59string(1) "1"
60string(3) "heh"
61string(1) "3"
62string(2) "25"
63string(4) "test"
64string(5) "blah3"
65array(1) {
66  [0]=>
67  string(2) "ar"
68}
69bool(true)
70
71Notice: Undefined variable: r_ap in %s on line %d
72string(1) "1"
73string(3) "heh"
74string(1) "3"
75NULL
76Done
77