« ResourceBundle::get
ResourceBundle::getErrorMessage »

ResourceBundle::getErrorCode

resourcebundle_get_error_code

(PHP 5 >= 5.3.2, PHP 7, PHP 8, PECL intl >= 2.0.0)

ResourceBundle::getErrorCode -- resourcebundle_get_error_code — バンドルの直近のエラーコードを取得する

説明

オブジェクト指向型

public function ResourceBundle::getErrorCode(): int

手続き型

function resourcebundle_get_error_code(ResourceBundle $bundle): int

バンドルオブジェクトが最後に実行した関数のエラーコードを取得します。

パラメータ

bundle

ResourceBundle オブジェクト。

戻り値

バンドルオブジェクトの最後の関数コールからのエラーコードを返します。

例

例1 resourcebundle_get_error_code() の例

<?php
$r = resourcebundle_create( 'es', "/usr/share/data/myapp");
echo $r['somestring'];
if(intl_is_failure(resourcebundle_get_error_code($r))) {
    report_error("Bundle error");
}
?>

例2 オブジェクト指向の例

<?php
$r = new ResourceBundle( 'es', "/usr/share/data/myapp");
echo $r['somestring'];
if(intl_is_failure(ResourceBundle::getErrorCode($r))) {
    report_error("Bundle error");
}
?>

参考

関連キーワード:
ResourceBundle   エラーコード   resourcebundle   バンドル   code   直近   intl   getErrorCode   failure   オブジェクト指向   bundle   最後   share   myapp   somestring   report   Bundle   getErrorMessage   手続き   create   参考   message   エラーメッセージ
関連する関数・ページ:
resourcebundle.geterrormessage   resourcebundle.count   resourcebundle.get   resourcebundle.create   resourcebundle.locales   class.resourcebundle