xref: /PHP-7.4/ext/filter/tests/024.phpt (revision 782352c5)
1--TEST--
2filter_var() and FILTER_SANITIZE_ENCODED
3--SKIPIF--
4<?php if (!extension_loaded("filter")) die("skip"); ?>
5--FILE--
6<?php
7
8var_dump(filter_var("\"<br>blah</ph>", FILTER_SANITIZE_ENCODED));
9var_dump(filter_var("", FILTER_SANITIZE_ENCODED));
10var_dump(filter_var("  text here  ", FILTER_SANITIZE_ENCODED));
11var_dump(filter_var("!@#$%^&*()QWERTYUIOP{ASDFGHJKL:\"ZXCVBNM<>?", FILTER_SANITIZE_ENCODED));
12
13echo "Done\n";
14?>
15--EXPECT--
16string(26) "%22%3Cbr%3Eblah%3C%2Fph%3E"
17string(0) ""
18string(23) "%20%20text%20here%20%20"
19string(74) "%21%40%23%24%25%5E%26%2A%28%29QWERTYUIOP%7BASDFGHJKL%3A%22ZXCVBNM%3C%3E%3F"
20Done
21