PageRenderTime 39ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

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

http://github.com/facebook/hiphop-php
PHP | 43 lines | 34 code | 8 blank | 1 comment | 0 complexity | 11034872f5e8775fd55ad75732496951 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/XHTML 1.0 ***\n";
  3. echo "-- with table = HTML_ENTITIES, ENT_QUOTES --\n";
  4. $table = HTML_ENTITIES;
  5. /* uses &#039; to share the code path with HTML 4.01 */
  6. $tt = get_html_translation_table($table, ENT_QUOTES | ENT_XHTML, "UTF-8");
  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_XHTML, "UTF-8");
  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_XHTML, "UTF-8");
  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, "UTF-8");
  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_XHTML, "UTF-8");
  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_XHTML, "UTF-8");
  32. asort( $tt );
  33. var_dump( $tt );
  34. echo "Done\n";
  35. ?>