1--TEST--
2Test get_html_translation_table() function : basic functionality - charset WINDOWS-1252
3--FILE--
4<?php
5/* Prototype  : array get_html_translation_table ( [int $table [, int $quote_style [, string charset_hint]]] )
6 * Description: Returns the internal translation table used by htmlspecialchars and htmlentities
7 * Source code: ext/standard/html.c
8*/
9
10
11echo "*** Testing get_html_translation_table() : basic functionality/Windows-1252 ***\n";
12
13echo "-- with table = HTML_ENTITIES --\n";
14$table = HTML_ENTITIES;
15$tt = get_html_translation_table($table, ENT_COMPAT, "WINDOWS-1252");
16asort( $tt );
17var_dump( $tt );
18
19echo "-- with table = HTML_SPECIALCHARS --\n";
20$table = HTML_SPECIALCHARS;
21$tt = get_html_translation_table($table, ENT_COMPAT, "WINDOWS-1252");
22asort( $tt );
23var_dump( $tt );
24
25echo "Done\n";
26?>
27--EXPECTF--
28*** Testing get_html_translation_table() : basic functionality/Windows-1252 ***
29-- with table = HTML_ENTITIES --
30array(125) {
31  ["�"]=>
32  string(7) "&AElig;"
33  ["�"]=>
34  string(8) "&Aacute;"
35  ["�"]=>
36  string(7) "&Acirc;"
37  ["�"]=>
38  string(8) "&Agrave;"
39  ["�"]=>
40  string(7) "&Aring;"
41  ["�"]=>
42  string(8) "&Atilde;"
43  ["�"]=>
44  string(6) "&Auml;"
45  ["�"]=>
46  string(8) "&Ccedil;"
47  ["�"]=>
48  string(8) "&Dagger;"
49  ["�"]=>
50  string(5) "&ETH;"
51  ["�"]=>
52  string(8) "&Eacute;"
53  ["�"]=>
54  string(7) "&Ecirc;"
55  ["�"]=>
56  string(8) "&Egrave;"
57  ["�"]=>
58  string(6) "&Euml;"
59  ["�"]=>
60  string(8) "&Iacute;"
61  ["�"]=>
62  string(7) "&Icirc;"
63  ["�"]=>
64  string(8) "&Igrave;"
65  ["�"]=>
66  string(6) "&Iuml;"
67  ["�"]=>
68  string(8) "&Ntilde;"
69  ["�"]=>
70  string(7) "&OElig;"
71  ["�"]=>
72  string(8) "&Oacute;"
73  ["�"]=>
74  string(7) "&Ocirc;"
75  ["�"]=>
76  string(8) "&Ograve;"
77  ["�"]=>
78  string(8) "&Oslash;"
79  ["�"]=>
80  string(8) "&Otilde;"
81  ["�"]=>
82  string(6) "&Ouml;"
83  ["�"]=>
84  string(8) "&Scaron;"
85  ["�"]=>
86  string(7) "&THORN;"
87  ["�"]=>
88  string(8) "&Uacute;"
89  ["�"]=>
90  string(7) "&Ucirc;"
91  ["�"]=>
92  string(8) "&Ugrave;"
93  ["�"]=>
94  string(6) "&Uuml;"
95  ["�"]=>
96  string(8) "&Yacute;"
97  ["�"]=>
98  string(6) "&Yuml;"
99  ["�"]=>
100  string(8) "&aacute;"
101  ["�"]=>
102  string(7) "&acirc;"
103  ["�"]=>
104  string(7) "&acute;"
105  ["�"]=>
106  string(7) "&aelig;"
107  ["�"]=>
108  string(8) "&agrave;"
109  ["&"]=>
110  string(5) "&amp;"
111  ["�"]=>
112  string(7) "&aring;"
113  ["�"]=>
114  string(8) "&atilde;"
115  ["�"]=>
116  string(6) "&auml;"
117  ["�"]=>
118  string(7) "&bdquo;"
119  ["�"]=>
120  string(8) "&brvbar;"
121  ["�"]=>
122  string(6) "&bull;"
123  ["�"]=>
124  string(8) "&ccedil;"
125  ["�"]=>
126  string(7) "&cedil;"
127  ["�"]=>
128  string(6) "&cent;"
129  ["�"]=>
130  string(6) "&circ;"
131  ["�"]=>
132  string(6) "&copy;"
133  ["�"]=>
134  string(8) "&curren;"
135  ["�"]=>
136  string(8) "&dagger;"
137  ["�"]=>
138  string(5) "&deg;"
139  ["�"]=>
140  string(8) "&divide;"
141  ["�"]=>
142  string(8) "&eacute;"
143  ["�"]=>
144  string(7) "&ecirc;"
145  ["�"]=>
146  string(8) "&egrave;"
147  ["�"]=>
148  string(5) "&eth;"
149  ["�"]=>
150  string(6) "&euml;"
151  ["�"]=>
152  string(6) "&euro;"
153  ["�"]=>
154  string(6) "&fnof;"
155  ["�"]=>
156  string(8) "&frac12;"
157  ["�"]=>
158  string(8) "&frac14;"
159  ["�"]=>
160  string(8) "&frac34;"
161  [">"]=>
162  string(4) "&gt;"
163  ["�"]=>
164  string(8) "&hellip;"
165  ["�"]=>
166  string(8) "&iacute;"
167  ["�"]=>
168  string(7) "&icirc;"
169  ["�"]=>
170  string(7) "&iexcl;"
171  ["�"]=>
172  string(8) "&igrave;"
173  ["�"]=>
174  string(8) "&iquest;"
175  ["�"]=>
176  string(6) "&iuml;"
177  ["�"]=>
178  string(7) "&laquo;"
179  ["�"]=>
180  string(7) "&ldquo;"
181  ["�"]=>
182  string(8) "&lsaquo;"
183  ["�"]=>
184  string(7) "&lsquo;"
185  ["<"]=>
186  string(4) "&lt;"
187  ["�"]=>
188  string(6) "&macr;"
189  ["�"]=>
190  string(7) "&mdash;"
191  ["�"]=>
192  string(7) "&micro;"
193  ["�"]=>
194  string(8) "&middot;"
195  ["�"]=>
196  string(6) "&nbsp;"
197  ["�"]=>
198  string(7) "&ndash;"
199  ["�"]=>
200  string(5) "&not;"
201  ["�"]=>
202  string(8) "&ntilde;"
203  ["�"]=>
204  string(8) "&oacute;"
205  ["�"]=>
206  string(7) "&ocirc;"
207  ["�"]=>
208  string(7) "&oelig;"
209  ["�"]=>
210  string(8) "&ograve;"
211  ["�"]=>
212  string(6) "&ordf;"
213  ["�"]=>
214  string(6) "&ordm;"
215  ["�"]=>
216  string(8) "&oslash;"
217  ["�"]=>
218  string(8) "&otilde;"
219  ["�"]=>
220  string(6) "&ouml;"
221  ["�"]=>
222  string(6) "&para;"
223  ["�"]=>
224  string(8) "&permil;"
225  ["�"]=>
226  string(8) "&plusmn;"
227  ["�"]=>
228  string(7) "&pound;"
229  ["""]=>
230  string(6) "&quot;"
231  ["�"]=>
232  string(7) "&raquo;"
233  ["�"]=>
234  string(7) "&rdquo;"
235  ["�"]=>
236  string(5) "&reg;"
237  ["�"]=>
238  string(8) "&rsaquo;"
239  ["�"]=>
240  string(7) "&rsquo;"
241  ["�"]=>
242  string(7) "&sbquo;"
243  ["�"]=>
244  string(8) "&scaron;"
245  ["�"]=>
246  string(6) "&sect;"
247  ["�"]=>
248  string(5) "&shy;"
249  ["�"]=>
250  string(6) "&sup1;"
251  ["�"]=>
252  string(6) "&sup2;"
253  ["�"]=>
254  string(6) "&sup3;"
255  ["�"]=>
256  string(7) "&szlig;"
257  ["�"]=>
258  string(7) "&thorn;"
259  ["�"]=>
260  string(7) "&tilde;"
261  ["�"]=>
262  string(7) "&times;"
263  ["�"]=>
264  string(7) "&trade;"
265  ["�"]=>
266  string(8) "&uacute;"
267  ["�"]=>
268  string(7) "&ucirc;"
269  ["�"]=>
270  string(8) "&ugrave;"
271  ["�"]=>
272  string(5) "&uml;"
273  ["�"]=>
274  string(6) "&uuml;"
275  ["�"]=>
276  string(8) "&yacute;"
277  ["�"]=>
278  string(5) "&yen;"
279  ["�"]=>
280  string(6) "&yuml;"
281}
282-- with table = HTML_SPECIALCHARS --
283array(4) {
284  ["&"]=>
285  string(5) "&amp;"
286  [">"]=>
287  string(4) "&gt;"
288  ["<"]=>
289  string(4) "&lt;"
290  ["""]=>
291  string(6) "&quot;"
292}
293Done
294