summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/html_entity_decode_html4.phpt
blob: 34753396de958ff53576e375669b3fa57f1ec0bf (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
--TEST--
html_entity_decode() conformance check (HTML 4)
--FILE--
<?php
$map = array(
	"&quot;",
	"&amp;",
	"&lt;",
	"&gt;",
	"&nbsp;",
	"&iexcl;",
	"&cent;",
	"&pound;",
	"&curren;",
	"&yen;",
	"&brvbar;",
	"&sect;",
	"&uml;",
	"&copy;",
	"&ordf;",
	"&laquo;",
	"&not;",
	"&shy;",
	"&reg;",
	"&macr;",
	"&deg;",
	"&plusmn;",
	"&sup2;",
	"&sup3;",
	"&acute;",
	"&micro;",
	"&para;",
	"&middot;",
	"&cedil;",
	"&sup1;",
	"&ordm;",
	"&raquo;",
	"&frac14;",
	"&frac12;",
	"&frac34;",
	"&iquest;",
	"&Agrave;",
	"&Aacute;",
	"&Acirc;",
	"&Atilde;",
	"&Auml;",
	"&Aring;",
	"&AElig;",
	"&Ccedil;",
	"&Egrave;",
	"&Eacute;",
	"&Ecirc;",
	"&Euml;",
	"&Igrave;",
	"&Iacute;",
	"&Icirc;",
	"&Iuml;",
	"&ETH;",
	"&Ntilde;",
	"&Ograve;",
	"&Oacute;",
	"&Ocirc;",
	"&Otilde;",
	"&Ouml;",
	"&times;",
	"&Oslash;",
	"&Ugrave;",
	"&Uacute;",
	"&Ucirc;",
	"&Uuml;",
	"&Yacute;",
	"&THORN;",
	"&szlig;",
	"&agrave;",
	"&aacute;",
	"&acirc;",
	"&atilde;",
	"&auml;",
	"&aring;",
	"&aelig;",
	"&ccedil;",
	"&egrave;",
	"&eacute;",
	"&ecirc;",
	"&euml;",
	"&igrave;",
	"&iacute;",
	"&icirc;",
	"&iuml;",
	"&eth;",
	"&ntilde;",
	"&ograve;",
	"&oacute;",
	"&ocirc;",
	"&otilde;",
	"&ouml;",
	"&divide;",
	"&oslash;",
	"&ugrave;",
	"&uacute;",
	"&ucirc;",
	"&uuml;",
	"&yacute;",
	"&thorn;",
	"&yuml;",
	"&OElig;",
	"&oelig;",
	"&Scaron;",
	"&scaron;",
	"&Yuml;",
	"&fnof;",
	"&circ;",
	"&tilde;",
	"&Alpha;",
	"&Beta;",
	"&Gamma;",
	"&Delta;",
	"&Epsilon;",
	"&Zeta;",
	"&Eta;",
	"&Theta;",
	"&Iota;",
	"&Kappa;",
	"&Lambda;",
	"&Mu;",
	"&Nu;",
	"&Xi;",
	"&Omicron;",
	"&Pi;",
	"&Rho;",
	"&Sigma;",
	"&Tau;",
	"&Upsilon;",
	"&Phi;",
	"&Chi;",
	"&Psi;",
	"&Omega;",
	"&alpha;",
	"&beta;",
	"&gamma;",
	"&delta;",
	"&epsilon;",
	"&zeta;",
	"&eta;",
	"&theta;",
	"&iota;",
	"&kappa;",
	"&lambda;",
	"&mu;",
	"&nu;",
	"&xi;",
	"&omicron;",
	"&pi;",
	"&rho;",
	"&sigmaf;",
	"&sigma;",
	"&tau;",
	"&upsilon;",
	"&phi;",
	"&chi;",
	"&psi;",
	"&omega;",
	"&thetasym;",
	"&upsih;",
	"&piv;",
	"&ensp;",
	"&emsp;",
	"&thinsp;",
	"&zwnj;",
	"&zwj;",
	"&lrm;",
	"&rlm;",
	"&ndash;",
	"&mdash;",
	"&lsquo;",
	"&rsquo;",
	"&sbquo;",
	"&ldquo;",
	"&rdquo;",
	"&bdquo;",
	"&dagger;",
	"&Dagger;",
	"&bull;",
	"&hellip;",
	"&permil;",
	"&prime;",
	"&Prime;",
	"&lsaquo;",
	"&rsaquo;",
	"&oline;",
	"&frasl;",
	"&euro;",
	"&image;",
	"&weierp;",
	"&real;",
	"&trade;",
	"&alefsym;",
	"&larr;",
	"&uarr;",
	"&rarr;",
	"&darr;",
	"&harr;",
	"&crarr;",
	"&lArr;",
	"&uArr;",
	"&rArr;",
	"&dArr;",
	"&hArr;",
	"&forall;",
	"&part;",
	"&exist;",
	"&empty;",
	"&nabla;",
	"&isin;",
	"&notin;",
	"&ni;",
	"&prod;",
	"&sum;",
	"&minus;",
	"&lowast;",
	"&radic;",
	"&prop;",
	"&infin;",
	"&ang;",
	"&and;",
	"&or;",
	"&cap;",
	"&cup;",
	"&int;",
	"&there4;",
	"&sim;",
	"&cong;",
	"&asymp;",
	"&ne;",
	"&equiv;",
	"&le;",
	"&ge;",
	"&sub;",
	"&sup;",
	"&nsub;",
	"&sube;",
	"&supe;",
	"&oplus;",
	"&otimes;",
	"&perp;",
	"&sdot;",
	"&lceil;",
	"&rceil;",
	"&lfloor;",
	"&rfloor;",
	"&lang;",
	"&rang;",
	"&loz;",
	"&spades;",
	"&clubs;",
	"&hearts;",
	"&diams;"
);

foreach ($map as $str) {
    echo bin2hex(html_entity_decode($str, ENT_QUOTES, "UTF-8")), "\n";
}
?>
--EXPECT--
22
26
3c
3e
c2a0
c2a1
c2a2
c2a3
c2a4
c2a5
c2a6
c2a7
c2a8
c2a9
c2aa
c2ab
c2ac
c2ad
c2ae
c2af
c2b0
c2b1
c2b2
c2b3
c2b4
c2b5
c2b6
c2b7
c2b8
c2b9
c2ba
c2bb
c2bc
c2bd
c2be
c2bf
c380
c381
c382
c383
c384
c385
c386
c387
c388
c389
c38a
c38b
c38c
c38d
c38e
c38f
c390
c391
c392
c393
c394
c395
c396
c397
c398
c399
c39a
c39b
c39c
c39d
c39e
c39f
c3a0
c3a1
c3a2
c3a3
c3a4
c3a5
c3a6
c3a7
c3a8
c3a9
c3aa
c3ab
c3ac
c3ad
c3ae
c3af
c3b0
c3b1
c3b2
c3b3
c3b4
c3b5
c3b6
c3b7
c3b8
c3b9
c3ba
c3bb
c3bc
c3bd
c3be
c3bf
c592
c593
c5a0
c5a1
c5b8
c692
cb86
cb9c
ce91
ce92
ce93
ce94
ce95
ce96
ce97
ce98
ce99
ce9a
ce9b
ce9c
ce9d
ce9e
ce9f
cea0
cea1
cea3
cea4
cea5
cea6
cea7
cea8
cea9
ceb1
ceb2
ceb3
ceb4
ceb5
ceb6
ceb7
ceb8
ceb9
ceba
cebb
cebc
cebd
cebe
cebf
cf80
cf81
cf82
cf83
cf84
cf85
cf86
cf87
cf88
cf89
cf91
cf92
cf96
e28082
e28083
e28089
e2808c
e2808d
e2808e
e2808f
e28093
e28094
e28098
e28099
e2809a
e2809c
e2809d
e2809e
e280a0
e280a1
e280a2
e280a6
e280b0
e280b2
e280b3
e280b9
e280ba
e280be
e28184
e282ac
e28491
e28498
e2849c
e284a2
e284b5
e28690
e28691
e28692
e28693
e28694
e286b5
e28790
e28791
e28792
e28793
e28794
e28880
e28882
e28883
e28885
e28887
e28888
e28889
e2888b
e2888f
e28891
e28892
e28897
e2889a
e2889d
e2889e
e288a0
e288a7
e288a8
e288a9
e288aa
e288ab
e288b4
e288bc
e28985
e28988
e289a0
e289a1
e289a4
e289a5
e28a82
e28a83
e28a84
e28a86
e28a87
e28a95
e28a97
e28aa5
e28b85
e28c88
e28c89
e28c8a
e28c8b
e28ca9
e28caa
e2978a
e299a0
e299a3
e299a5
e299a6