ResourceBundle::getErrorCode

(PHP >= 5.3.2, PECL intl >= 2.0.0)
Get bundle's last error code.
public int ResourceBundle::getErrorCode ( void )

Object oriented style

Procedural style

int resourcebundle_get_error_code ( ResourceBundle $r )

Get error code from the last function performed by the bundle object.

Parameters:
r

ResourceBundle object.

Returns:

Returns error code from last bundle object call.

Examples:
resourcebundle_get_error_code() example
<?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");
}
?>

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

See also:

resourcebundle_get_error_message() -

intl_get_error_code() -

intl_is_failure() -

doc_php
2016-02-24 15:57:51
Comments
Leave a Comment

Please login to continue.