1--TEST-- 2Test get_html_translation_table() function : basic functionality - with default args 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/* Test get_html_translation_table() when table is specified as HTML_ENTITIES */ 11 12 13echo "*** Testing get_html_translation_table() : basic functionality ***\n"; 14 15echo "-- with table = HTML_ENTITIES --\n"; 16$table = HTML_ENTITIES; 17var_dump( get_html_translation_table($table, ENT_COMPAT, "UTF-8") ); 18 19echo "-- with table = HTML_SPECIALCHARS --\n"; 20$table = HTML_SPECIALCHARS; 21var_dump( get_html_translation_table($table, ENT_COMPAT, "UTF-8") ); 22 23echo "Done\n"; 24?> 25--EXPECTF-- 26*** Testing get_html_translation_table() : basic functionality *** 27-- with table = HTML_ENTITIES -- 28array(252) { 29 [" "]=> 30 string(6) " " 31 ["¡"]=> 32 string(7) "¡" 33 ["¢"]=> 34 string(6) "¢" 35 ["£"]=> 36 string(7) "£" 37 ["¤"]=> 38 string(8) "¤" 39 ["¥"]=> 40 string(5) "¥" 41 ["¦"]=> 42 string(8) "¦" 43 ["§"]=> 44 string(6) "§" 45 ["¨"]=> 46 string(5) "¨" 47 ["©"]=> 48 string(6) "©" 49 ["ª"]=> 50 string(6) "ª" 51 ["«"]=> 52 string(7) "«" 53 ["¬"]=> 54 string(5) "¬" 55 [""]=> 56 string(5) "­" 57 ["®"]=> 58 string(5) "®" 59 ["¯"]=> 60 string(6) "¯" 61 ["°"]=> 62 string(5) "°" 63 ["±"]=> 64 string(8) "±" 65 ["²"]=> 66 string(6) "²" 67 ["³"]=> 68 string(6) "³" 69 ["´"]=> 70 string(7) "´" 71 ["µ"]=> 72 string(7) "µ" 73 ["¶"]=> 74 string(6) "¶" 75 ["·"]=> 76 string(8) "·" 77 ["¸"]=> 78 string(7) "¸" 79 ["¹"]=> 80 string(6) "¹" 81 ["º"]=> 82 string(6) "º" 83 ["»"]=> 84 string(7) "»" 85 ["¼"]=> 86 string(8) "¼" 87 ["½"]=> 88 string(8) "½" 89 ["¾"]=> 90 string(8) "¾" 91 ["¿"]=> 92 string(8) "¿" 93 ["À"]=> 94 string(8) "À" 95 ["Á"]=> 96 string(8) "Á" 97 ["Â"]=> 98 string(7) "Â" 99 ["Ã"]=> 100 string(8) "Ã" 101 ["Ä"]=> 102 string(6) "Ä" 103 ["Å"]=> 104 string(7) "Å" 105 ["Æ"]=> 106 string(7) "Æ" 107 ["Ç"]=> 108 string(8) "Ç" 109 ["È"]=> 110 string(8) "È" 111 ["É"]=> 112 string(8) "É" 113 ["Ê"]=> 114 string(7) "Ê" 115 ["Ë"]=> 116 string(6) "Ë" 117 ["Ì"]=> 118 string(8) "Ì" 119 ["Í"]=> 120 string(8) "Í" 121 ["Î"]=> 122 string(7) "Î" 123 ["Ï"]=> 124 string(6) "Ï" 125 ["Ð"]=> 126 string(5) "Ð" 127 ["Ñ"]=> 128 string(8) "Ñ" 129 ["Ò"]=> 130 string(8) "Ò" 131 ["Ó"]=> 132 string(8) "Ó" 133 ["Ô"]=> 134 string(7) "Ô" 135 ["Õ"]=> 136 string(8) "Õ" 137 ["Ö"]=> 138 string(6) "Ö" 139 ["×"]=> 140 string(7) "×" 141 ["Ø"]=> 142 string(8) "Ø" 143 ["Ù"]=> 144 string(8) "Ù" 145 ["Ú"]=> 146 string(8) "Ú" 147 ["Û"]=> 148 string(7) "Û" 149 ["Ü"]=> 150 string(6) "Ü" 151 ["Ý"]=> 152 string(8) "Ý" 153 ["Þ"]=> 154 string(7) "Þ" 155 ["ß"]=> 156 string(7) "ß" 157 ["à"]=> 158 string(8) "à" 159 ["á"]=> 160 string(8) "á" 161 ["â"]=> 162 string(7) "â" 163 ["ã"]=> 164 string(8) "ã" 165 ["ä"]=> 166 string(6) "ä" 167 ["å"]=> 168 string(7) "å" 169 ["æ"]=> 170 string(7) "æ" 171 ["ç"]=> 172 string(8) "ç" 173 ["è"]=> 174 string(8) "è" 175 ["é"]=> 176 string(8) "é" 177 ["ê"]=> 178 string(7) "ê" 179 ["ë"]=> 180 string(6) "ë" 181 ["ì"]=> 182 string(8) "ì" 183 ["í"]=> 184 string(8) "í" 185 ["î"]=> 186 string(7) "î" 187 ["ï"]=> 188 string(6) "ï" 189 ["ð"]=> 190 string(5) "ð" 191 ["ñ"]=> 192 string(8) "ñ" 193 ["ò"]=> 194 string(8) "ò" 195 ["ó"]=> 196 string(8) "ó" 197 ["ô"]=> 198 string(7) "ô" 199 ["õ"]=> 200 string(8) "õ" 201 ["ö"]=> 202 string(6) "ö" 203 ["÷"]=> 204 string(8) "÷" 205 ["ø"]=> 206 string(8) "ø" 207 ["ù"]=> 208 string(8) "ù" 209 ["ú"]=> 210 string(8) "ú" 211 ["û"]=> 212 string(7) "û" 213 ["ü"]=> 214 string(6) "ü" 215 ["ý"]=> 216 string(8) "ý" 217 ["þ"]=> 218 string(7) "þ" 219 ["ÿ"]=> 220 string(6) "ÿ" 221 ["Œ"]=> 222 string(7) "Œ" 223 ["œ"]=> 224 string(7) "œ" 225 ["Š"]=> 226 string(8) "Š" 227 ["š"]=> 228 string(8) "š" 229 ["Ÿ"]=> 230 string(6) "Ÿ" 231 ["ƒ"]=> 232 string(6) "ƒ" 233 ["ˆ"]=> 234 string(6) "ˆ" 235 ["˜"]=> 236 string(7) "˜" 237 ["Α"]=> 238 string(7) "Α" 239 ["Β"]=> 240 string(6) "Β" 241 ["Γ"]=> 242 string(7) "Γ" 243 ["Δ"]=> 244 string(7) "Δ" 245 ["Ε"]=> 246 string(9) "Ε" 247 ["Ζ"]=> 248 string(6) "Ζ" 249 ["Η"]=> 250 string(5) "Η" 251 ["Θ"]=> 252 string(7) "Θ" 253 ["Ι"]=> 254 string(6) "Ι" 255 ["Κ"]=> 256 string(7) "Κ" 257 ["Λ"]=> 258 string(8) "Λ" 259 ["Μ"]=> 260 string(4) "Μ" 261 ["Ν"]=> 262 string(4) "Ν" 263 ["Ξ"]=> 264 string(4) "Ξ" 265 ["Ο"]=> 266 string(9) "Ο" 267 ["Π"]=> 268 string(4) "Π" 269 ["Ρ"]=> 270 string(5) "Ρ" 271 ["Σ"]=> 272 string(7) "Σ" 273 ["Τ"]=> 274 string(5) "Τ" 275 ["Υ"]=> 276 string(9) "Υ" 277 ["Φ"]=> 278 string(5) "Φ" 279 ["Χ"]=> 280 string(5) "Χ" 281 ["Ψ"]=> 282 string(5) "Ψ" 283 ["Ω"]=> 284 string(7) "Ω" 285 ["α"]=> 286 string(7) "α" 287 ["β"]=> 288 string(6) "β" 289 ["γ"]=> 290 string(7) "γ" 291 ["δ"]=> 292 string(7) "δ" 293 ["ε"]=> 294 string(9) "ε" 295 ["ζ"]=> 296 string(6) "ζ" 297 ["η"]=> 298 string(5) "η" 299 ["θ"]=> 300 string(7) "θ" 301 ["ι"]=> 302 string(6) "ι" 303 ["κ"]=> 304 string(7) "κ" 305 ["λ"]=> 306 string(8) "λ" 307 ["μ"]=> 308 string(4) "μ" 309 ["ν"]=> 310 string(4) "ν" 311 ["ξ"]=> 312 string(4) "ξ" 313 ["ο"]=> 314 string(9) "ο" 315 ["π"]=> 316 string(4) "π" 317 ["ρ"]=> 318 string(5) "ρ" 319 ["ς"]=> 320 string(8) "ς" 321 ["σ"]=> 322 string(7) "σ" 323 ["τ"]=> 324 string(5) "τ" 325 ["υ"]=> 326 string(9) "υ" 327 ["φ"]=> 328 string(5) "φ" 329 ["χ"]=> 330 string(5) "χ" 331 ["ψ"]=> 332 string(5) "ψ" 333 ["ω"]=> 334 string(7) "ω" 335 ["ϑ"]=> 336 string(10) "ϑ" 337 ["ϒ"]=> 338 string(7) "ϒ" 339 ["ϖ"]=> 340 string(5) "ϖ" 341 [" "]=> 342 string(6) " " 343 [" "]=> 344 string(6) " " 345 [" "]=> 346 string(8) " " 347 [""]=> 348 string(6) "‌" 349 [""]=> 350 string(5) "‍" 351 [""]=> 352 string(5) "‎" 353 [""]=> 354 string(5) "‏" 355 ["–"]=> 356 string(7) "–" 357 ["—"]=> 358 string(7) "—" 359 ["‘"]=> 360 string(7) "‘" 361 ["’"]=> 362 string(7) "’" 363 ["‚"]=> 364 string(7) "‚" 365 ["“"]=> 366 string(7) "“" 367 ["”"]=> 368 string(7) "”" 369 ["„"]=> 370 string(7) "„" 371 ["†"]=> 372 string(8) "†" 373 ["‡"]=> 374 string(8) "‡" 375 ["•"]=> 376 string(6) "•" 377 ["…"]=> 378 string(8) "…" 379 ["‰"]=> 380 string(8) "‰" 381 ["′"]=> 382 string(7) "′" 383 ["″"]=> 384 string(7) "″" 385 ["‹"]=> 386 string(8) "‹" 387 ["›"]=> 388 string(8) "›" 389 ["‾"]=> 390 string(7) "‾" 391 ["⁄"]=> 392 string(7) "⁄" 393 ["€"]=> 394 string(6) "€" 395 ["ℑ"]=> 396 string(7) "ℑ" 397 ["℘"]=> 398 string(8) "℘" 399 ["ℜ"]=> 400 string(6) "ℜ" 401 ["™"]=> 402 string(7) "™" 403 ["ℵ"]=> 404 string(9) "ℵ" 405 ["←"]=> 406 string(6) "←" 407 ["↑"]=> 408 string(6) "↑" 409 ["→"]=> 410 string(6) "→" 411 ["↓"]=> 412 string(6) "↓" 413 ["↔"]=> 414 string(6) "↔" 415 ["↵"]=> 416 string(7) "↵" 417 ["⇐"]=> 418 string(6) "⇐" 419 ["⇑"]=> 420 string(6) "⇑" 421 ["⇒"]=> 422 string(6) "⇒" 423 ["⇓"]=> 424 string(6) "⇓" 425 ["⇔"]=> 426 string(6) "⇔" 427 ["∀"]=> 428 string(8) "∀" 429 ["∂"]=> 430 string(6) "∂" 431 ["∃"]=> 432 string(7) "∃" 433 ["∅"]=> 434 string(7) "∅" 435 ["∇"]=> 436 string(7) "∇" 437 ["∈"]=> 438 string(6) "∈" 439 ["∉"]=> 440 string(7) "∉" 441 ["∋"]=> 442 string(4) "∋" 443 ["∏"]=> 444 string(6) "∏" 445 ["∑"]=> 446 string(5) "∑" 447 ["−"]=> 448 string(7) "−" 449 ["∗"]=> 450 string(8) "∗" 451 ["√"]=> 452 string(7) "√" 453 ["∝"]=> 454 string(6) "∝" 455 ["∞"]=> 456 string(7) "∞" 457 ["∠"]=> 458 string(5) "∠" 459 ["∧"]=> 460 string(5) "∧" 461 ["∨"]=> 462 string(4) "∨" 463 ["∩"]=> 464 string(5) "∩" 465 ["∪"]=> 466 string(5) "∪" 467 ["∫"]=> 468 string(5) "∫" 469 ["∴"]=> 470 string(8) "∴" 471 ["∼"]=> 472 string(5) "∼" 473 ["≅"]=> 474 string(6) "≅" 475 ["≈"]=> 476 string(7) "≈" 477 ["≠"]=> 478 string(4) "≠" 479 ["≡"]=> 480 string(7) "≡" 481 ["≤"]=> 482 string(4) "≤" 483 ["≥"]=> 484 string(4) "≥" 485 ["⊂"]=> 486 string(5) "⊂" 487 ["⊃"]=> 488 string(5) "⊃" 489 ["⊄"]=> 490 string(6) "⊄" 491 ["⊆"]=> 492 string(6) "⊆" 493 ["⊇"]=> 494 string(6) "⊇" 495 ["⊕"]=> 496 string(7) "⊕" 497 ["⊗"]=> 498 string(8) "⊗" 499 ["⊥"]=> 500 string(6) "⊥" 501 ["⋅"]=> 502 string(6) "⋅" 503 ["⌈"]=> 504 string(7) "⌈" 505 ["⌉"]=> 506 string(7) "⌉" 507 ["⌊"]=> 508 string(8) "⌊" 509 ["⌋"]=> 510 string(8) "⌋" 511 ["〈"]=> 512 string(6) "⟨" 513 ["〉"]=> 514 string(6) "⟩" 515 ["◊"]=> 516 string(5) "◊" 517 ["♠"]=> 518 string(8) "♠" 519 ["♣"]=> 520 string(7) "♣" 521 ["♥"]=> 522 string(8) "♥" 523 ["♦"]=> 524 string(7) "♦" 525 ["&"]=> 526 string(5) "&" 527 ["""]=> 528 string(6) """ 529 ["<"]=> 530 string(4) "<" 531 [">"]=> 532 string(4) ">" 533} 534-- with table = HTML_SPECIALCHARS -- 535array(4) { 536 ["&"]=> 537 string(5) "&" 538 ["""]=> 539 string(6) """ 540 ["<"]=> 541 string(4) "<" 542 [">"]=> 543 string(4) ">" 544} 545Done 546