CakeFest 2024: The Official CakePHP Conference

IntlCalendar::getErrorMessage

intlcal_get_error_message

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

IntlCalendar::getErrorMessage -- intlcal_get_error_messageオブジェクトの直近のエラーメッセージを取得する

説明

オブジェクト指向型 (method):

public IntlCalendar::getErrorMessage(): string|false

手続き型:

intlcal_get_error_message(IntlCalendar $calendar): string|false

IntlCalendar::getErrorCode()intlcal_get_error_code() によって報告されたエラーに関連するエラーメッセージを(もしあれば)返します。 関連するエラーメッセージが存在しない場合、 エラー定数の名前の文字列表現だけを返します。 エラーメッセージが存在する場合、 PHP バインディングの側で設定されたメッセージを含む文字列を返します。

パラメータ

calendar

手続き型のインターフェイスで指定する、カレンダーオブジェクト

戻り値

このオブジェクトにおける関数コールで発生した、 直近のエラーに関連するメッセージを返します。 または、エラーが発生しないことを示す文字列を返します。 失敗した場合は false を返します。

例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 note

User Contributed Notes

There are no user contributed notes for this page.
To Top