PageRenderTime 41ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/test/zend/bad/ext/standard/tests/strings/get_html_translation_table_basic9.php

http://github.com/facebook/hiphop-php
PHP | 43 lines | 35 code | 8 blank | 0 comment | 0 complexity | 4c661fbd20793a709ff94fe138b4fcc8 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. <?php
  2. echo "*** Testing get_html_translation_table() : basic functionality/HTML5/SJIS ***\n";
  3. echo "*** Only basic entities supported! ***\n";
  4. echo "-- with table = HTML_ENTITIES, ENT_QUOTES --\n";
  5. $table = HTML_ENTITIES;
  6. $tt = get_html_translation_table($table, ENT_QUOTES | ENT_HTML5, "SJIS");
  7. asort( $tt );
  8. var_dump( count($tt) );
  9. print_r( $tt );
  10. echo "-- with table = HTML_ENTITIES, ENT_COMPAT --\n";
  11. $table = HTML_ENTITIES;
  12. $tt = get_html_translation_table($table, ENT_COMPAT | ENT_HTML5, "SJIS");
  13. var_dump( count($tt) );
  14. echo "-- with table = HTML_ENTITIES, ENT_NOQUOTES --\n";
  15. $table = HTML_ENTITIES;
  16. $tt = get_html_translation_table($table, ENT_NOQUOTES | ENT_HTML5, "SJIS");
  17. var_dump( count($tt) );
  18. echo "-- with table = HTML_SPECIALCHARS, ENT_COMPAT --\n";
  19. $table = HTML_SPECIALCHARS;
  20. $tt = get_html_translation_table($table, ENT_COMPAT, "SJIS");
  21. asort( $tt );
  22. var_dump( count($tt) );
  23. print_r( $tt );
  24. echo "-- with table = HTML_SPECIALCHARS, ENT_QUOTES --\n";
  25. $table = HTML_SPECIALCHARS;
  26. $tt = get_html_translation_table($table, ENT_QUOTES | ENT_HTML5, "SJIS");
  27. asort( $tt );
  28. var_dump( $tt );
  29. echo "-- with table = HTML_SPECIALCHARS, ENT_NOQUOTES --\n";
  30. $table = HTML_SPECIALCHARS;
  31. $tt = get_html_translation_table($table, ENT_NOQUOTES | ENT_HTML5, "SJIS");
  32. asort( $tt );
  33. var_dump( $tt );
  34. echo "Done\n";
  35. ?>