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