1--TEST-- 2Test get_html_translation_table() function : basic functionality - table as HTML_SPECIALCHARS 3--FILE-- 4<?php 5/* test get_html_translation_table() when $table argument is specified as HTML_SPECIALCHARS */ 6 7echo "*** Testing get_html_translation_table() : basic functionality ***\n"; 8 9// $table as HTML_SEPCIALCHARS and different quote style 10echo "-- with table = HTML_SPECIALCHARS & quote_style = ENT_COMPAT --\n"; 11$table = HTML_SPECIALCHARS; 12$quote_style = ENT_COMPAT; 13$tt = get_html_translation_table($table, $quote_style, "UTF-8"); 14asort( $tt ); 15var_dump( $tt ); 16 17echo "-- with table = HTML_SPECIALCHARS & quote_style = ENT_QUOTES --\n"; 18$quote_style = ENT_QUOTES; 19$tt = get_html_translation_table($table, $quote_style, "UTF-8"); 20asort( $tt ); 21var_dump( $tt ); 22 23echo "-- with table = HTML_SPECIALCHARS & quote_style = ENT_NOQUOTES --\n"; 24$quote_style = ENT_NOQUOTES; 25$tt = get_html_translation_table($table, $quote_style, "UTF-8"); 26asort( $tt ); 27var_dump( $tt ); 28 29echo "Done\n"; 30?> 31--EXPECT-- 32*** Testing get_html_translation_table() : basic functionality *** 33-- with table = HTML_SPECIALCHARS & quote_style = ENT_COMPAT -- 34array(4) { 35 ["&"]=> 36 string(5) "&" 37 [">"]=> 38 string(4) ">" 39 ["<"]=> 40 string(4) "<" 41 ["""]=> 42 string(6) """ 43} 44-- with table = HTML_SPECIALCHARS & quote_style = ENT_QUOTES -- 45array(5) { 46 ["'"]=> 47 string(6) "'" 48 ["&"]=> 49 string(5) "&" 50 [">"]=> 51 string(4) ">" 52 ["<"]=> 53 string(4) "<" 54 ["""]=> 55 string(6) """ 56} 57-- with table = HTML_SPECIALCHARS & quote_style = ENT_NOQUOTES -- 58array(3) { 59 ["&"]=> 60 string(5) "&" 61 [">"]=> 62 string(4) ">" 63 ["<"]=> 64 string(4) "<" 65} 66Done 67