Definition and Usage:
Error_reporting () Sets the error level for PHP and returns the current level.
function Syntax:
Error_reporting (Report_level)
If the parameter level is not specified, the current error levels are returned. The following items are possible values for level:
Value constant Description
1 E_error fatal run error. The error cannot be resumed and execution of the script is paused.
2 e_warning Run-time warning (non-fatal error). Non-fatal run error, script execution does not stop.
4 E_parse Compile-time parse error. Parsing errors are generated only by the parser.
8 E_notice Runtime reminders, which are often caused by bugs in your code, or by intentional behavior.
E_core_error a fatal error during initialization of PHP startup.
e_core_warning PHP Startup warning (non-fatal error) during initialization.
E_compile_error compile-time fatal error. This is like a e_error generated by the Zend scripting engine.
E_compile_warning Compile-time warning (non-fatal error). This is like a e_warning warning generated by the Zend scripting engine.
E_user_error user-defined error message. This is like a warning message by using the PHP function Trigger_error (programmer set E_error)
e_user_warning user-defined. This is like using a PHP function Trigger_error (a e_warning warning set by the programmer) to
E_user_notice user-defined reminder messages. This is like a standardized warning by using the PHP function Trigger_error (programmer a E_notice set)
2048 e_strict encoding. Allows PHP to suggest how to modify the code to ensure the best interoperability forward compatibility.
4096 e_recoverable_error to catch fatal error. This is like a e_error, but can be captured through user-defined processing (see also Set_error_handler ())
8191 E_all all errors and warnings (excluding e_strict) (E_strict will is part of E_all As of PHP 6.0)
Example:
Any number of the above options can be connected (with OR or |) using "or" to report all required levels of errors.
For example, the following code turns off user-defined errors and warnings, performs certain actions, and then reverts to the original error level:
disabling error Reporting
error_reporting (0);
Report Run-time errors
Error_reporting (E_error | e_warning | E_parse);
Report All Errors
Error_reporting (E_all);
?>
http://www.bkjia.com/PHPjc/477986.html www.bkjia.com true http://www.bkjia.com/PHPjc/477986.html techarticle definition and Usage: error_reporting () sets the error level for PHP and returns the current level. function syntax: error_reporting (report_level) If the parameter level is unspecified, the current error levels ...