summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/bug53021.phpt
blob: cdb408db63bed696c69ed4e2b13314f899af9fba (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
--TEST--
Bug #53021 (Failure to convert numeric entities with ENT_NOQUOTES and ISO-8859-1)
--FILE--
<?php
var_dump(unpack("H*",html_entity_decode("&#233;", ENT_QUOTES, "ISO-8859-1")));
echo "double quotes variations:", "\n";
echo html_entity_decode("&quot;", ENT_NOQUOTES, 'UTF-8'), "\n";
echo html_entity_decode("&#34;", ENT_NOQUOTES, 'UTF-8'), "\n";
echo html_entity_decode("&quot;", ENT_QUOTES, 'UTF-8'), "\n";
echo html_entity_decode("&#34;", ENT_QUOTES, 'UTF-8'), "\n";
echo html_entity_decode("&quot;", ENT_COMPAT, 'UTF-8'), "\n";
echo html_entity_decode("&#34;", ENT_COMPAT, 'UTF-8'), "\n";
echo html_entity_decode("&quot;"), "\n";
echo html_entity_decode("&#34;"), "\n";

echo "\nsingle quotes variations:", "\n";
echo html_entity_decode("&#39;", ENT_NOQUOTES, 'UTF-8'), "\n";
echo html_entity_decode("&#39;", ENT_QUOTES, 'UTF-8'), "\n";
echo html_entity_decode("&#39;", ENT_COMPAT, 'UTF-8'), "\n";
echo html_entity_decode("&#39;"), "\n";
?>
--EXPECT--
array(1) {
  [1]=>
  string(2) "e9"
}
double quotes variations:
&quot;
&#34;
"
"
"
"
"
"

single quotes variations:
&#39;
'
&#39;
&#39;