略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: IntlCalendar::getErrorMessage

2024-11-14

IntlCalendar::getErrorMessage

intlcal_get_error_message

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

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

说明

面向对象风格 (method):

public IntlCalendar::getErrorMessage(): string|false

过程化风格:

intlcal_get_error_message(IntlCalendar $calendar): string|false

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.

参数

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-existence of an error. Returns false on failure.

范例

示例 #1 IntlCalendar::getErrorMessage()

<?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"
add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/intlcalendar.geterrormessage.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3