1--TEST--
2HTML entities with invalid chars and ENT_IGNORE
3--INI--
4output_handler=
5--FILE--
6<?php
7@setlocale (LC_CTYPE, "C");
8$strings = array("<", "\xD0", "\xD0\x90", "\xD0\x90\xD0", "\xD0\x90\xD0\xB0", "\xE0", "A\xE0", "\xE0\x80", "\xE0\x79", "\xE0\x80\xBE",
9	"Voil\xE0", "Clich\xE9s",
10	"\xFE", "\xFE\x41", "\xC3\xA9", "\xC3\x79", "\xF7\xBF\xBF\xBF", "\xFB\xBF\xBF\xBF\xBF", "\xFD\xBF\xBF\xBF\xBF\xBF",
11	"\x41\xF7\xF7\x42", "\x42\xFB\xFB\x42", "\x43\xFD\xFD\x42", "\x44\xF7\xF7", "\x45\xFB\xFB", "\x46\xFD\xFD"
12	);
13foreach($strings as $string) {
14	$sc_encoded = htmlspecialchars ($string, ENT_QUOTES | ENT_IGNORE, "utf-8");
15	var_dump(bin2hex($sc_encoded));
16	$ent_encoded = htmlentities ($string, ENT_QUOTES | ENT_IGNORE, "utf-8");
17	var_dump(bin2hex($ent_encoded));
18}
19?>
20--EXPECT--
21string(8) "266c743b"
22string(8) "266c743b"
23string(0) ""
24string(0) ""
25string(4) "d090"
26string(4) "d090"
27string(4) "d090"
28string(4) "d090"
29string(8) "d090d0b0"
30string(8) "d090d0b0"
31string(0) ""
32string(0) ""
33string(2) "41"
34string(2) "41"
35string(0) ""
36string(0) ""
37string(2) "79"
38string(2) "79"
39string(0) ""
40string(0) ""
41string(8) "566f696c"
42string(8) "566f696c"
43string(12) "436c69636873"
44string(12) "436c69636873"
45string(0) ""
46string(0) ""
47string(2) "41"
48string(2) "41"
49string(4) "c3a9"
50string(16) "266561637574653b"
51string(2) "79"
52string(2) "79"
53string(0) ""
54string(0) ""
55string(0) ""
56string(0) ""
57string(0) ""
58string(0) ""
59string(4) "4142"
60string(4) "4142"
61string(4) "4242"
62string(4) "4242"
63string(4) "4342"
64string(4) "4342"
65string(2) "44"
66string(2) "44"
67string(2) "45"
68string(2) "45"
69string(2) "46"
70string(2) "46"
71