1--TEST--
2htmlentities() / htmlspecialchars() "don't double encode" flag support
3--FILE--
4<?php
5$tests = array(
6	"abc",
7	"abc&amp;sfdsa",
8	"test&#043;s &amp; some more &#68;",
9	"test&#x2b;s &amp; some more &#X44;",
10	"&; &amp &#a; &9; &#xyz;",
11	"&kffjadfdhsjfhjasdhffasdfas;",
12	"&#8787978789",
13	"&",
14	"&&amp;&",
15	"&ab&amp;&",
16);
17
18foreach ($tests as $test) {
19	var_dump(htmlentities($test, ENT_QUOTES, NULL, FALSE));
20	var_dump(htmlspecialchars($test, ENT_QUOTES, NULL, FALSE));
21}
22?>
23--EXPECT--
24string(3) "abc"
25string(3) "abc"
26string(13) "abc&amp;sfdsa"
27string(13) "abc&amp;sfdsa"
28string(33) "test&#043;s &amp; some more &#68;"
29string(33) "test&#043;s &amp; some more &#68;"
30string(34) "test&#x2b;s &amp; some more &#X44;"
31string(34) "test&#x2b;s &amp; some more &#X44;"
32string(43) "&amp;; &amp;amp &amp;#a; &amp;9; &amp;#xyz;"
33string(43) "&amp;; &amp;amp &amp;#a; &amp;9; &amp;#xyz;"
34string(32) "&amp;kffjadfdhsjfhjasdhffasdfas;"
35string(32) "&amp;kffjadfdhsjfhjasdhffasdfas;"
36string(16) "&amp;#8787978789"
37string(16) "&amp;#8787978789"
38string(5) "&amp;"
39string(5) "&amp;"
40string(15) "&amp;&amp;&amp;"
41string(15) "&amp;&amp;&amp;"
42string(17) "&amp;ab&amp;&amp;"
43string(17) "&amp;ab&amp;&amp;"
44