1--TEST--
2Test strip_tags() function : basic functionality - with default arguments
3--FILE--
4<?php
5echo "*** Testing strip_tags() : basic functionality ***\n";
6
7// array of arguments
8$string_array = array (
9  "<html>hello</html>",
10  '<html>hello</html>',
11  "<?php echo hello ?>",
12  '<?php echo hello ?>',
13  "<? echo hello ?>",
14  '<? echo hello ?>',
15  "<% echo hello %>",
16  '<% echo hello %>',
17  "<script language=\"PHP\"> echo hello </script>",
18  '<script language=\"PHP\"> echo hello </script>',
19  "<html><b>hello</b><p>world</p></html>",
20  '<html><b>hello</b><p>world</p></html>',
21  "<html><!-- COMMENT --></html>",
22  '<html><!-- COMMENT --></html>'
23);
24
25
26// Calling strip_tags() with default arguments
27// loop through the $string_array to test strip_tags on various inputs
28$iteration = 1;
29foreach($string_array as $string)
30{
31  echo "-- Iteration $iteration --\n";
32  var_dump( strip_tags($string) );
33  $iteration++;
34}
35
36echo "Done";
37?>
38--EXPECT--
39*** Testing strip_tags() : basic functionality ***
40-- Iteration 1 --
41string(5) "hello"
42-- Iteration 2 --
43string(5) "hello"
44-- Iteration 3 --
45string(0) ""
46-- Iteration 4 --
47string(0) ""
48-- Iteration 5 --
49string(0) ""
50-- Iteration 6 --
51string(0) ""
52-- Iteration 7 --
53string(0) ""
54-- Iteration 8 --
55string(0) ""
56-- Iteration 9 --
57string(12) " echo hello "
58-- Iteration 10 --
59string(12) " echo hello "
60-- Iteration 11 --
61string(10) "helloworld"
62-- Iteration 12 --
63string(10) "helloworld"
64-- Iteration 13 --
65string(0) ""
66-- Iteration 14 --
67string(0) ""
68Done
69