首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

IntlCalendar::getErrorMessage

(PHP 5.5.0, PHP 7, PECL >= 3.0.0a1)

IntlCalendar::getErrorMessage -- intlcal_get_error_message — Get last error message on the object

Description

Object oriented style (method):

代码语言:javascript
复制
public string IntlCalendar::getErrorMessage ( void )

Procedural style:

代码语言:javascript
复制
string intlcal_get_error_message ( IntlCalendar $calendar )

Returns the error message (if any) associated with the error reported by IntlCalendar::getErrorCode() or intlcal_get_error_code(). If there is no associated error message, only the string representation of the name of the error constant will be returned. Otherwise, the message also includes a message set on the side of the PHP binding.

Parameters

calendar

The calendar object, on the procedural style interface.

Return Values

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.

Examples

Example #1 IntlCalendar::getErrorMessage()

代码语言:javascript
复制
<?php
$cal?=?IntlCalendar::createInstance('UTC',?'en_US');
var_dump($cal->getErrorMessage());

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

The above example will output:

代码语言:javascript
复制
string(12) "U_ZERO_ERROR"
string(82) "intlcal_get_weekend_transition: Error calling ICU method: U_ILLEGAL_ARGUMENT_ERROR"

← IntlCalendar::getErrorCode

IntlCalendar::getFirstDayOfWeek →

代码语言:txt
复制
 ? 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com