PHP 8.5.0 Alpha 2 available for testing

ResourceBundle::getErrorMessage

resourcebundle_get_error_message

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

ResourceBundle::getErrorMessage -- resourcebundle_get_error_messageRecupera el último mensaje de error desde el haz

Descripción

Estilo orientado a objetos

public ResourceBundle::getErrorMessage(): string

Estilo procedimental

resourcebundle_get_error_message(ResourceBundle $bundle): string

Recupera el mensaje de error desde la última función ejecutada sobre el objeto del haz.

Parámetros

bundle

Un objeto ResourceBundle.

Valores devueltos

Devuelve el mensaje de error desde la última llamada sobre el objeto del haz.

Ejemplos

Ejemplo #1 Ejemplo con resourcebundle_get_error_message()

<?php
$r
= resourcebundle_create( 'es', "/usr/share/data/myapp");
echo
$r['somestring'];
if(
intl_is_failure(resourcebundle_get_error_code($r))) {
report_error("Error en el haz : ".resourcebundle_get_error_message($r));
}
?>

Ejemplo #2 Ejemplo orientado a objetos

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

Ver también

add a note

User Contributed Notes

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