PHP restore_exception_handler() 함수
예시
예외 처리기 복원 예:
<?php
// Two user-defined exception handler functions
function myException1($exception)
{
echo "[" . __FUNCTION__ . "]" . $exception->getMessage();
}
function myException2($exception)
{
echo "[" . __FUNCTION__ . "]" . $exception->getMessage();
}
set_exception_handler("myException1");
set_exception_handler("myException2");
restore_exception_handler();
// Throw exception
throw new Exception("This triggers the first exception handler...");
?>
정의 및 사용
restore_exception_handler() 함수는 이전 예외 핸들러를 복원합니다.
이 함수는 set_exception_handler() 함수 로 변경한 이전 예외 처리기를 복원하는 데 사용됩니다 .
팁: 이전 예외 처리기는 기본 제공 예외 처리기 또는 사용자 정의 예외 처리기 함수일 수 있습니다.
통사론
restore_exception_handler();
기술적 세부 사항
반환 값: | 항상 참 |
---|---|
PHP 버전: | 5.0+ |
PHP 오류 참조