« intl_error_name
intl_get_error_message »

intl_get_error_code

(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL intl >= 1.0.0)

intl_get_error_code — 直近のエラーコードを取得する

説明

function intl_get_error_code(): int

staticメソッドを実行した場合など、 エラーコードを取得するオブジェクトが存在しない場合のエラー処理に便利です。

パラメータ

この関数にはパラメータはありません。

戻り値

直近の API 関数のコールが返すエラーコードを返します。

例

例1 intl_get_error_code() の例

<?php
$coll = collator_create( '<bad_param>' );
if( !$coll ) {
    handle_error( intl_get_error_code() );
}
?>

参考

関連キーワード:
intl   エラーコード   直近   code   collator   message   coll   国際化   static   便利   create   param   handle   参考   failure   numfmt   フォーマッタ
関連する関数・ページ:
function.intl-error-name   function.intl-is-failure   ref.intl   function.intl-get-error-message   function.fdf-error   intlcalendar.geterrorcode