common_api.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * Handling of errors occurred in static methods
  4. * when there's no object to get error code/message from.
  5. *
  6. * Example #1:
  7. * <code>
  8. * $coll = collator_create( '<bad_param>' );
  9. * if( !$coll )
  10. * handle_error( intl_get_error_code() );
  11. * </code>
  12. *
  13. * Example #2:
  14. * <code>
  15. * if( Collator::getAvailableLocales() === false )
  16. * show_error( intl_get_error_message() );
  17. * </code>
  18. */
  19. /**
  20. * Get the last error code.
  21. *
  22. * @return int Error code returned by the last
  23. * API function call.
  24. */
  25. function intl_get_error_code() {}
  26. /**
  27. * Get description of the last error.
  28. *
  29. * @return string Description of an error occurred in the last
  30. * API function call.
  31. */
  32. function intl_get_error_message() {}
  33. /**
  34. * Check whether the given error code indicates failure.
  35. *
  36. * @param int $code ICU error code.
  37. *
  38. * @return bool true if it the code indicates some failure,
  39. * and false in case of success or a warning.
  40. */
  41. function intl_is_failure($code) {}
  42. /**
  43. * Get symbolic name for a given error code.
  44. *
  45. * The returned string will be the same as the name of the error code constant.
  46. *
  47. * @param int $code ICU error code.
  48. *
  49. * @return string Error code name.
  50. */
  51. function intl_error_name($code) {}