summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/htmlentities18.phpt
blob: d7bd2302c1657e729c7aadd35b728a2fcc1256c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--TEST--
htmlentities() / htmlspecialchars() "don't double encode" flag support
--FILE--
<?php
$tests = array(
	"abc",
	"abc&amp;sfdsa",
	"test&#043;s &amp; some more &#68;",
	"test&#x2b;s &amp; some more &#X44;",
	"&; &amp &#a; &9; &#xyz;",
	"&kffjadfdhsjfhjasdhffasdfas;",
	"&#8787978789",
	"&",
	"&&amp;&",
	"&ab&amp;&",
);

foreach ($tests as $test) {
	var_dump(htmlentities($test, ENT_QUOTES, NULL, FALSE));
	var_dump(htmlspecialchars($test, ENT_QUOTES, NULL, FALSE));
}
?>
--EXPECT--
string(3) "abc"
string(3) "abc"
string(13) "abc&amp;sfdsa"
string(13) "abc&amp;sfdsa"
string(33) "test&#043;s &amp; some more &#68;"
string(33) "test&#043;s &amp; some more &#68;"
string(34) "test&#x2b;s &amp; some more &#X44;"
string(34) "test&#x2b;s &amp; some more &#X44;"
string(43) "&amp;; &amp;amp &amp;#a; &amp;9; &amp;#xyz;"
string(43) "&amp;; &amp;amp &amp;#a; &amp;9; &amp;#xyz;"
string(32) "&amp;kffjadfdhsjfhjasdhffasdfas;"
string(32) "&amp;kffjadfdhsjfhjasdhffasdfas;"
string(16) "&amp;#8787978789"
string(16) "&amp;#8787978789"
string(5) "&amp;"
string(5) "&amp;"
string(15) "&amp;&amp;&amp;"
string(15) "&amp;&amp;&amp;"
string(17) "&amp;ab&amp;&amp;"
string(17) "&amp;ab&amp;&amp;"