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

intl_error_name

PHP function Edit on GitHub ✎

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

Get symbolic name for a given error code

Description

intl_error_name(int $errorCode): string

Return ICU error code name.

Parameters

errorCode

ICU error code.

Return Values

The returned string will be the same as the name of the error code constant.

Examples

intl_error_name() example

php
<?php
$coll     = collator_create( 'en_RU' );
$err_code = collator_get_error_code( $coll );

printf( "Symbolic name for %d is %s\n.", $err_code, intl_error_name( $err_code ) );
?>

The above example will output something similar to:

output
Symbolic name for -128 is U_USING_FALLBACK_WARNING.

See Also

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