1--TEST--
2Test htmlspecialchars_decode() function : basic functionality
3--FILE--
4<?php
5echo "*** Testing htmlspecialchars_decode() : basic functionality ***\n";
6
7
8// Initialise arguments
9//value initialized = Roy's height > Sam's height. 13 < 25. 1111 & 0000 = 0000. "double quoted string"
10$single_quote_string = "Roy&#039;s height &gt; Sam&#039;s height. 13 &lt; 25. 1111 &amp; 0000 = 0000. &quot; double quoted string &quot;";
11$double_quote_string = "Roy&#039;s height &gt; Sam&#039;s height. 13 &lt; 25. 1111 &amp; 0000 = 0000. &quot; double quoted string &quot;";
12
13// Calling htmlspecialchars_decode() with default arguments
14var_dump( htmlspecialchars_decode($single_quote_string) );
15var_dump( htmlspecialchars_decode($double_quote_string) );
16
17// Calling htmlspecialchars_decode() with optional 'quote_style' argument
18var_dump( htmlspecialchars_decode($single_quote_string, ENT_COMPAT) );
19var_dump( htmlspecialchars_decode($double_quote_string, ENT_COMPAT) );
20var_dump( htmlspecialchars_decode($single_quote_string, ENT_NOQUOTES) );
21var_dump( htmlspecialchars_decode($double_quote_string, ENT_NOQUOTES) );
22var_dump( htmlspecialchars_decode($single_quote_string, ENT_QUOTES) );
23var_dump( htmlspecialchars_decode($double_quote_string, ENT_QUOTES) );
24
25echo "Done";
26?>
27--EXPECT--
28*** Testing htmlspecialchars_decode() : basic functionality ***
29string(82) "Roy's height > Sam's height. 13 < 25. 1111 & 0000 = 0000. " double quoted string ""
30string(82) "Roy's height > Sam's height. 13 < 25. 1111 & 0000 = 0000. " double quoted string ""
31string(92) "Roy&#039;s height > Sam&#039;s height. 13 < 25. 1111 & 0000 = 0000. " double quoted string ""
32string(92) "Roy&#039;s height > Sam&#039;s height. 13 < 25. 1111 & 0000 = 0000. " double quoted string ""
33string(102) "Roy&#039;s height > Sam&#039;s height. 13 < 25. 1111 & 0000 = 0000. &quot; double quoted string &quot;"
34string(102) "Roy&#039;s height > Sam&#039;s height. 13 < 25. 1111 & 0000 = 0000. &quot; double quoted string &quot;"
35string(82) "Roy's height > Sam's height. 13 < 25. 1111 & 0000 = 0000. " double quoted string ""
36string(82) "Roy's height > Sam's height. 13 < 25. 1111 & 0000 = 0000. " double quoted string ""
37Done
38