Internationalization ResourceBundle::getErrorCode
ResourceBundle::getErrorCode
resourcebundle_get_error_code
(PHP 5 >= 5.3.2, PHP 7, PHP 8, PECL intl >= 2.0.0)
ResourceBundle::getErrorCode -- resourcebundle_get_error_code — 번들의 마지막 오류 코드 가져오기
설명
객체 지향 스타일
public ResourceBundle::getErrorCode(): int
절차 스타일:
resourcebundle_get_error_code(ResourceBundle $bundle
): int
번들 객체가 수행한 마지막 함수에서 오류 코드를 가져옵니다.
매개변수
bundle
- ResourceBundle 개체.
반환 값
마지막 번들 개체 호출에서 오류 코드를 반환합니다.
Examples
예제 #1 resourcebundle_get_error_code() 예제
<?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");
}
?>
예제 #2 OO 예제
<?php
$r = new ResourceBundle( 'es', "/usr/share/data/myapp");
echo $r['somestring'];
if(intl_is_failure(ResourceBundle::getErrorCode($r))) {
report_error("Bundle error");
}
?>
기타
- resourcebundle_get_error_message() - 번들의 마지막 오류 메시지 가져오기
- intl_get_error_code() - 마지막 오류 코드 가져오기
- intl_is_failure() - 주어진 오류 코드가 실패를 나타내는지 확인