xref: /PHP-8.2/ext/filter/tests/007.phpt (revision 74859783)
1--TEST--
2filter_has_var()
3--EXTENSIONS--
4filter
5--GET--
6a=qwe&abc=<a>href</a>
7--POST--
8b=qwe&bbc=<a>href</a>
9--FILE--
10<?php
11
12var_dump(filter_has_var(INPUT_GET, "a"));
13var_dump(filter_has_var(INPUT_GET, "abc"));
14var_dump(filter_has_var(INPUT_GET, "nonex"));
15var_dump(filter_has_var(INPUT_GET, " "));
16var_dump(filter_has_var(INPUT_GET, ""));
17
18var_dump(filter_has_var(INPUT_POST, "b"));
19var_dump(filter_has_var(INPUT_POST, "bbc"));
20var_dump(filter_has_var(INPUT_POST, "nonex"));
21var_dump(filter_has_var(INPUT_POST, " "));
22var_dump(filter_has_var(INPUT_POST, ""));
23
24echo "Done\n";
25?>
26--EXPECT--
27bool(true)
28bool(true)
29bool(false)
30bool(false)
31bool(false)
32bool(true)
33bool(true)
34bool(false)
35bool(false)
36bool(false)
37Done
38