PHP error_reporting() 함수
예시
다른 오류 수준 보고 지정:
<?php
// Turn off error reporting
error_reporting(0);
// Report runtime errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);
// Report all errors
error_reporting(E_ALL);
// Same as error_reporting(E_ALL);
ini_set("error_reporting", E_ALL);
// Report all errors except E_NOTICE
error_reporting(E_ALL & ~E_NOTICE);
?>
정의 및 사용
error_reporting() 함수는 보고되는 오류를 지정합니다.
PHP에는 많은 수준의 오류가 있으며 이 함수를 사용하면 현재 스크립트에 대해 해당 수준을 설정합니다.
통사론
error_reporting(level);
매개변수 값
Parameter | Description |
---|---|
level | Optional. Specifies the error-report level for the current script. Error numbers and named constants are accepted. Note: Named constants are recommended to ensure compatibility for future PHP versions |
기술적 세부 사항
반환 값: | 수준 매개변수가 지정 되지 않은 경우 이전 오류 보고 수준 또는 현재 오류 보고 수준을 반환합니다. |
---|---|
PHP 버전: | 4.0+ |
PHP 변경 로그: | PHP 5.4: E_STRICT는 이제 E_ALL의 일부입니다. PHP 5.3: 새로운 기능: E_DEPRECATED 및 E_USER_DEPRECATED. PHP 5.2: 새로운 기능: E_RECOVERABLE_ERROR. PHP 5.0: 새로운 기능: E_STRICT. |
PHP 오류 참조