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--EXPECT-- 28*** Testing get_html_translation_table() : basic functionality/Windows-1252 *** 29-- with table = HTML_ENTITIES -- 30array(125) { 31 ["�"]=> 32 string(7) "Æ" 33 ["�"]=> 34 string(8) "Á" 35 ["�"]=> 36 string(7) "Â" 37 ["�"]=> 38 string(8) "À" 39 ["�"]=> 40 string(7) "Å" 41 ["�"]=> 42 string(8) "Ã" 43 ["�"]=> 44 string(6) "Ä" 45 ["�"]=> 46 string(8) "Ç" 47 ["�"]=> 48 string(8) "‡" 49 ["�"]=> 50 string(5) "Ð" 51 ["�"]=> 52 string(8) "É" 53 ["�"]=> 54 string(7) "Ê" 55 ["�"]=> 56 string(8) "È" 57 ["�"]=> 58 string(6) "Ë" 59 ["�"]=> 60 string(8) "Í" 61 ["�"]=> 62 string(7) "Î" 63 ["�"]=> 64 string(8) "Ì" 65 ["�"]=> 66 string(6) "Ï" 67 ["�"]=> 68 string(8) "Ñ" 69 ["�"]=> 70 string(7) "Œ" 71 ["�"]=> 72 string(8) "Ó" 73 ["�"]=> 74 string(7) "Ô" 75 ["�"]=> 76 string(8) "Ò" 77 ["�"]=> 78 string(8) "Ø" 79 ["�"]=> 80 string(8) "Õ" 81 ["�"]=> 82 string(6) "Ö" 83 ["�"]=> 84 string(8) "Š" 85 ["�"]=> 86 string(7) "Þ" 87 ["�"]=> 88 string(8) "Ú" 89 ["�"]=> 90 string(7) "Û" 91 ["�"]=> 92 string(8) "Ù" 93 ["�"]=> 94 string(6) "Ü" 95 ["�"]=> 96 string(8) "Ý" 97 ["�"]=> 98 string(6) "Ÿ" 99 ["�"]=> 100 string(8) "á" 101 ["�"]=> 102 string(7) "â" 103 ["�"]=> 104 string(7) "´" 105 ["�"]=> 106 string(7) "æ" 107 ["�"]=> 108 string(8) "à" 109 ["&"]=> 110 string(5) "&" 111 ["�"]=> 112 string(7) "å" 113 ["�"]=> 114 string(8) "ã" 115 ["�"]=> 116 string(6) "ä" 117 ["�"]=> 118 string(7) "„" 119 ["�"]=> 120 string(8) "¦" 121 ["�"]=> 122 string(6) "•" 123 ["�"]=> 124 string(8) "ç" 125 ["�"]=> 126 string(7) "¸" 127 ["�"]=> 128 string(6) "¢" 129 ["�"]=> 130 string(6) "ˆ" 131 ["�"]=> 132 string(6) "©" 133 ["�"]=> 134 string(8) "¤" 135 ["�"]=> 136 string(8) "†" 137 ["�"]=> 138 string(5) "°" 139 ["�"]=> 140 string(8) "÷" 141 ["�"]=> 142 string(8) "é" 143 ["�"]=> 144 string(7) "ê" 145 ["�"]=> 146 string(8) "è" 147 ["�"]=> 148 string(5) "ð" 149 ["�"]=> 150 string(6) "ë" 151 ["�"]=> 152 string(6) "€" 153 ["�"]=> 154 string(6) "ƒ" 155 ["�"]=> 156 string(8) "½" 157 ["�"]=> 158 string(8) "¼" 159 ["�"]=> 160 string(8) "¾" 161 [">"]=> 162 string(4) ">" 163 ["�"]=> 164 string(8) "…" 165 ["�"]=> 166 string(8) "í" 167 ["�"]=> 168 string(7) "î" 169 ["�"]=> 170 string(7) "¡" 171 ["�"]=> 172 string(8) "ì" 173 ["�"]=> 174 string(8) "¿" 175 ["�"]=> 176 string(6) "ï" 177 ["�"]=> 178 string(7) "«" 179 ["�"]=> 180 string(7) "“" 181 ["�"]=> 182 string(8) "‹" 183 ["�"]=> 184 string(7) "‘" 185 ["<"]=> 186 string(4) "<" 187 ["�"]=> 188 string(6) "¯" 189 ["�"]=> 190 string(7) "—" 191 ["�"]=> 192 string(7) "µ" 193 ["�"]=> 194 string(8) "·" 195 ["�"]=> 196 string(6) " " 197 ["�"]=> 198 string(7) "–" 199 ["�"]=> 200 string(5) "¬" 201 ["�"]=> 202 string(8) "ñ" 203 ["�"]=> 204 string(8) "ó" 205 ["�"]=> 206 string(7) "ô" 207 ["�"]=> 208 string(7) "œ" 209 ["�"]=> 210 string(8) "ò" 211 ["�"]=> 212 string(6) "ª" 213 ["�"]=> 214 string(6) "º" 215 ["�"]=> 216 string(8) "ø" 217 ["�"]=> 218 string(8) "õ" 219 ["�"]=> 220 string(6) "ö" 221 ["�"]=> 222 string(6) "¶" 223 ["�"]=> 224 string(8) "‰" 225 ["�"]=> 226 string(8) "±" 227 ["�"]=> 228 string(7) "£" 229 ["""]=> 230 string(6) """ 231 ["�"]=> 232 string(7) "»" 233 ["�"]=> 234 string(7) "”" 235 ["�"]=> 236 string(5) "®" 237 ["�"]=> 238 string(8) "›" 239 ["�"]=> 240 string(7) "’" 241 ["�"]=> 242 string(7) "‚" 243 ["�"]=> 244 string(8) "š" 245 ["�"]=> 246 string(6) "§" 247 ["�"]=> 248 string(5) "­" 249 ["�"]=> 250 string(6) "¹" 251 ["�"]=> 252 string(6) "²" 253 ["�"]=> 254 string(6) "³" 255 ["�"]=> 256 string(7) "ß" 257 ["�"]=> 258 string(7) "þ" 259 ["�"]=> 260 string(7) "˜" 261 ["�"]=> 262 string(7) "×" 263 ["�"]=> 264 string(7) "™" 265 ["�"]=> 266 string(8) "ú" 267 ["�"]=> 268 string(7) "û" 269 ["�"]=> 270 string(8) "ù" 271 ["�"]=> 272 string(5) "¨" 273 ["�"]=> 274 string(6) "ü" 275 ["�"]=> 276 string(8) "ý" 277 ["�"]=> 278 string(5) "¥" 279 ["�"]=> 280 string(6) "ÿ" 281} 282-- with table = HTML_SPECIALCHARS -- 283array(4) { 284 ["&"]=> 285 string(5) "&" 286 [">"]=> 287 string(4) ">" 288 ["<"]=> 289 string(4) "<" 290 ["""]=> 291 string(6) """ 292} 293Done 294