xref: /PHP-5.5/ext/filter/tests/043.phpt (revision 2c3db736)
1--TEST--
2Character encoding test
3--SKIPIF--
4<?php if (!extension_loaded("filter")) die("skip"); ?>
5--FILE--
6<?php
7$flags = FILTER_FLAG_ENCODE_AMP|FILTER_FLAG_ENCODE_LOW|FILTER_FLAG_ENCODE_HIGH;
8
9for ($i = 0; $i < 256; $i++) {
10	var_dump(filter_var(chr($i), FILTER_SANITIZE_STRING, array("flags" => $flags)));
11}
12?>
13--EXPECT--
14string(4) "&#0;"
15string(4) "&#1;"
16string(4) "&#2;"
17string(4) "&#3;"
18string(4) "&#4;"
19string(4) "&#5;"
20string(4) "&#6;"
21string(4) "&#7;"
22string(4) "&#8;"
23string(4) "&#9;"
24string(5) "&#10;"
25string(5) "&#11;"
26string(5) "&#12;"
27string(5) "&#13;"
28string(5) "&#14;"
29string(5) "&#15;"
30string(5) "&#16;"
31string(5) "&#17;"
32string(5) "&#18;"
33string(5) "&#19;"
34string(5) "&#20;"
35string(5) "&#21;"
36string(5) "&#22;"
37string(5) "&#23;"
38string(5) "&#24;"
39string(5) "&#25;"
40string(5) "&#26;"
41string(5) "&#27;"
42string(5) "&#28;"
43string(5) "&#29;"
44string(5) "&#30;"
45string(5) "&#31;"
46string(1) " "
47string(1) "!"
48string(5) "&#34;"
49string(1) "#"
50string(1) "$"
51string(1) "%"
52string(5) "&#38;"
53string(5) "&#39;"
54string(1) "("
55string(1) ")"
56string(1) "*"
57string(1) "+"
58string(1) ","
59string(1) "-"
60string(1) "."
61string(1) "/"
62string(1) "0"
63string(1) "1"
64string(1) "2"
65string(1) "3"
66string(1) "4"
67string(1) "5"
68string(1) "6"
69string(1) "7"
70string(1) "8"
71string(1) "9"
72string(1) ":"
73string(1) ";"
74string(0) ""
75string(1) "="
76string(1) ">"
77string(1) "?"
78string(1) "@"
79string(1) "A"
80string(1) "B"
81string(1) "C"
82string(1) "D"
83string(1) "E"
84string(1) "F"
85string(1) "G"
86string(1) "H"
87string(1) "I"
88string(1) "J"
89string(1) "K"
90string(1) "L"
91string(1) "M"
92string(1) "N"
93string(1) "O"
94string(1) "P"
95string(1) "Q"
96string(1) "R"
97string(1) "S"
98string(1) "T"
99string(1) "U"
100string(1) "V"
101string(1) "W"
102string(1) "X"
103string(1) "Y"
104string(1) "Z"
105string(1) "["
106string(1) "\"
107string(1) "]"
108string(1) "^"
109string(1) "_"
110string(1) "`"
111string(1) "a"
112string(1) "b"
113string(1) "c"
114string(1) "d"
115string(1) "e"
116string(1) "f"
117string(1) "g"
118string(1) "h"
119string(1) "i"
120string(1) "j"
121string(1) "k"
122string(1) "l"
123string(1) "m"
124string(1) "n"
125string(1) "o"
126string(1) "p"
127string(1) "q"
128string(1) "r"
129string(1) "s"
130string(1) "t"
131string(1) "u"
132string(1) "v"
133string(1) "w"
134string(1) "x"
135string(1) "y"
136string(1) "z"
137string(1) "{"
138string(1) "|"
139string(1) "}"
140string(1) "~"
141string(6) "&#127;"
142string(6) "&#128;"
143string(6) "&#129;"
144string(6) "&#130;"
145string(6) "&#131;"
146string(6) "&#132;"
147string(6) "&#133;"
148string(6) "&#134;"
149string(6) "&#135;"
150string(6) "&#136;"
151string(6) "&#137;"
152string(6) "&#138;"
153string(6) "&#139;"
154string(6) "&#140;"
155string(6) "&#141;"
156string(6) "&#142;"
157string(6) "&#143;"
158string(6) "&#144;"
159string(6) "&#145;"
160string(6) "&#146;"
161string(6) "&#147;"
162string(6) "&#148;"
163string(6) "&#149;"
164string(6) "&#150;"
165string(6) "&#151;"
166string(6) "&#152;"
167string(6) "&#153;"
168string(6) "&#154;"
169string(6) "&#155;"
170string(6) "&#156;"
171string(6) "&#157;"
172string(6) "&#158;"
173string(6) "&#159;"
174string(6) "&#160;"
175string(6) "&#161;"
176string(6) "&#162;"
177string(6) "&#163;"
178string(6) "&#164;"
179string(6) "&#165;"
180string(6) "&#166;"
181string(6) "&#167;"
182string(6) "&#168;"
183string(6) "&#169;"
184string(6) "&#170;"
185string(6) "&#171;"
186string(6) "&#172;"
187string(6) "&#173;"
188string(6) "&#174;"
189string(6) "&#175;"
190string(6) "&#176;"
191string(6) "&#177;"
192string(6) "&#178;"
193string(6) "&#179;"
194string(6) "&#180;"
195string(6) "&#181;"
196string(6) "&#182;"
197string(6) "&#183;"
198string(6) "&#184;"
199string(6) "&#185;"
200string(6) "&#186;"
201string(6) "&#187;"
202string(6) "&#188;"
203string(6) "&#189;"
204string(6) "&#190;"
205string(6) "&#191;"
206string(6) "&#192;"
207string(6) "&#193;"
208string(6) "&#194;"
209string(6) "&#195;"
210string(6) "&#196;"
211string(6) "&#197;"
212string(6) "&#198;"
213string(6) "&#199;"
214string(6) "&#200;"
215string(6) "&#201;"
216string(6) "&#202;"
217string(6) "&#203;"
218string(6) "&#204;"
219string(6) "&#205;"
220string(6) "&#206;"
221string(6) "&#207;"
222string(6) "&#208;"
223string(6) "&#209;"
224string(6) "&#210;"
225string(6) "&#211;"
226string(6) "&#212;"
227string(6) "&#213;"
228string(6) "&#214;"
229string(6) "&#215;"
230string(6) "&#216;"
231string(6) "&#217;"
232string(6) "&#218;"
233string(6) "&#219;"
234string(6) "&#220;"
235string(6) "&#221;"
236string(6) "&#222;"
237string(6) "&#223;"
238string(6) "&#224;"
239string(6) "&#225;"
240string(6) "&#226;"
241string(6) "&#227;"
242string(6) "&#228;"
243string(6) "&#229;"
244string(6) "&#230;"
245string(6) "&#231;"
246string(6) "&#232;"
247string(6) "&#233;"
248string(6) "&#234;"
249string(6) "&#235;"
250string(6) "&#236;"
251string(6) "&#237;"
252string(6) "&#238;"
253string(6) "&#239;"
254string(6) "&#240;"
255string(6) "&#241;"
256string(6) "&#242;"
257string(6) "&#243;"
258string(6) "&#244;"
259string(6) "&#245;"
260string(6) "&#246;"
261string(6) "&#247;"
262string(6) "&#248;"
263string(6) "&#249;"
264string(6) "&#250;"
265string(6) "&#251;"
266string(6) "&#252;"
267string(6) "&#253;"
268string(6) "&#254;"
269string(6) "&#255;"
270