error_get_last
(PHP 5 >= 5.2.0, PHP 7, PHP 8)
error_get_last - 마지막으로 발생한 오류를 가져옵니다.
설명
error_get_last(): ?array
마지막으로 발생한 오류에 대한 정보를 가져옵니다.
매개변수
이 함수에는 매개변수가 없습니다.
반환 값
"type", "message", "file" 및 "line" 키를 사용하여 마지막 오류를 설명하는 연관 배열을 반환합니다. 오류가 PHP 내부 함수로 인해 발생한 경우 "메시지"는 해당 이름으로 시작합니다. 아직 오류가 없으면 null
을 반환합니다.
Examples
예제 #1 error_get_last() 예제
<?php
echo $a;
print_r(error_get_last());
?>
위의 예는 다음과 유사한 결과를 출력합니다.
Array ( [type] => 8 [message] => Undefined variable: a [file] => C:\WWW\index.php [line] => 2 )
기타
- Error constants
- Variable $php_errormsg
- error_clear_last() - Clear the most recent error
- Directive
display_errors
- Directive
html_errors
- Directive
xmlrpc_errors