IntlCalendar
在线手册:中文  英文

IntlCalendar::getErrorMessage

intlcal_get_error_message

(PHP 5.5.0, PECL >= 3.0.0a1)

IntlCalendar::getErrorMessage -- intlcal_get_error_messageGet last error message on the object

说明

面向对象风格 (method):

public string IntlCalendar::getErrorMessage ( void )

过程化风格:

string intlcal_get_error_message ( IntlCalendar $calendar )

Returns the error message associated with the last error error that occurred on a method call on this object, in any of the alternative functions that take an IntlCalendar as its first argument or in some other contexts such as cloning. However, invalid argument errors on the PHP side do not set any error retrievable through this function (only through the global intl_get_error_message().

The message generally includes a string representation of an ICU error code (its constant name) and a message set on the side of the PHP binding.

参数

calendar

The calendar object, on the procedural style interface.

返回值

The error message associated with last error that occurred in a function call on this object, or a string indicating the non-existance of an error.

范例

Example #1 XXX() examples

<?php
$cal 
IntlCalendar::createInstance('UTC''en_US');
var_dump($cal->getErrorMessage());

$cal->getWeekendTransition(IntlCalendar::DOW_WEDNESDAY);
var_dump($cal->getErrorMessage());

以上例程会输出:

string(12) "U_ZERO_ERROR"
string(82) "intlcal_get_weekend_transition: Error calling ICU method: U_ILLEGAL_ARGUMENT_ERROR"


IntlCalendar
在线手册:中文  英文
易百教程