php8.5
Home/ Manual/ intl / functions/ intl_is_failure

intl_is_failure

PHP function Edit on GitHub ✎

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

Check whether the given error code indicates failure

Description

intl_is_failure(int $errorCode): bool

Parameters

errorCode

is a value that returned by functions: intl_get_error_code(), collator_get_error_code() .

Return Values

true if it the code indicates some failure, and false in case of success or a warning.

Examples

intl_is_failure() example

php
<?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 );
?>

The above example will output something similar to:

output
false
false
true

See Also

Source: reference/intl/functions/intl-is-failure.xml · from the official PHP manual (php/doc-en)