CakeFest 2024: The Official CakePHP Conference

intl_is_failure

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

intl_is_failure指定したエラーコードが失敗を表すかどうかを調べる

説明

intl_is_failure(int $errorCode): bool

パラメータ

errorCode

intl_get_error_code()collator_get_error_code() が返す値。

戻り値

そのコードが何らかの失敗を意味する場合に true、 成功あるいは警告を意味する場合に false を返します。

例1 intl_is_failure() example

<?php
function check( $err_code )
{
var_export( intl_is_failure( $err_code ) );
echo
"\n";
}

check( U_ZERO_ERROR );
check( U_USING_FALLBACK_WARNING );
check( U_ILLEGAL_ARGUMENT_ERROR );
?>

上の例の出力は、 たとえば以下のようになります。

false
false
true

参考

add a note

User Contributed Notes

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