htmlentities17.phpt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --TEST--
  2. htmlentities() / html_entity_decode() #8592 - #9002 table test
  3. --FILE--
  4. <?php
  5. $tests = array(
  6. array(8853, '&oplus;', "e28a95"),
  7. array(8855, '&otimes;', "e28a97"),
  8. array(8869, '&perp;', "e28aa5"),
  9. array(8901, '&sdot;', "e28b85"),
  10. array(8968, '&lceil;', "e28c88"),
  11. array(8969, '&rceil;', "e28c89"),
  12. array(8970, '&lfloor;', "e28c8a"),
  13. array(8971, '&rfloor;', "e28c8b"),
  14. array(9001, '&lang;', "e28ca9"),
  15. array(9002, '&rang;', "e28caa")
  16. );
  17. foreach ($tests as $test) {
  18. var_dump(htmlentities(pack('H*', $test[2]), ENT_QUOTES, 'UTF-8'));
  19. }
  20. foreach ($tests as $test) {
  21. list(,$result) = unpack('H6', html_entity_decode($test[1], ENT_QUOTES, 'UTF-8'));
  22. var_dump($result);
  23. }
  24. ?>
  25. --EXPECT--
  26. string(7) "&oplus;"
  27. string(8) "&otimes;"
  28. string(6) "&perp;"
  29. string(6) "&sdot;"
  30. string(7) "&lceil;"
  31. string(7) "&rceil;"
  32. string(8) "&lfloor;"
  33. string(8) "&rfloor;"
  34. string(6) "&lang;"
  35. string(6) "&rang;"
  36. string(6) "e28a95"
  37. string(6) "e28a97"
  38. string(6) "e28aa5"
  39. string(6) "e28b85"
  40. string(6) "e28c88"
  41. string(6) "e28c89"
  42. string(6) "e28c8a"
  43. string(6) "e28c8b"
  44. string(6) "e28ca9"
  45. string(6) "e28caa"