PHP Tutorial Error Report open detailed implementation
Definition and usage
Error_reporting () Sets the error level for PHP and returns the current level.
Grammar
Error_reporting (Report_level) If the parameter level is not specified, the current error levels will be returned. The following items are the possible values of level
*/
Close all error reports
error_reporting (0);
Report only running errors
Error_reporting (E_error|e_warning|e_parse);
Report E_notice
Error_reporting (E_error|e_warning|e_parse|e_notice);
Report all running errors, except E_notice
This is the default value for PHP.ini
Error_reporting (e_all ^ e_notice);
Report All PHP errors
Error_reporting (E_all);
and error_reporting (E_all) have the same effect, this setting will also report all PHP errors
Ini_set (' error_reporting ', e_all);
/*
Value constant Description
1 E_error fatal Run-time errors. Errors that can is recovered from. Execution of the script is halted
2 e_warning non-fatal run-time errors. Execution of the script is not halted
4 E_parse compile-time Parse errors. Parse errors should only being generated by the parser
8 E_notice Run-time Notices. The script found something that might is an error, but could also happen when running a script normally
E_core_error fatal errors at PHP startup. This is a e_error in the PHP core
e_core_warning non-fatal errors at php startup. This is a e_warning in the PHP core
E_compile_error Fatal Compile-time errors. This is a e_error generated by the Zend scripting engine
E_compile_warning non-fatal compile-time errors. This is a e_warning generated by the Zend scripting engine
E_user_error Fatal user-generated error. This is a e_error set by the programmer using the PHP function Trigger_error ()
E_user_warning non-fatal user-generated Warning. This is a e_warning set by the programmer using the PHP function Trigger_error ()
1024x768 E_user_notice user-generated Notice. This is a e_notice set by the programmer using the PHP function Trigger_error ()
2048 e_strict Run-time Notices. PHP suggest changes to your code to help interoperability and compatibility of the code
4096 E_recoverable_error catchable fatal error. This is a e_error, but can being caught by a user defined handle (see also Set_error_handler ())
8191 E_all all errors and warnings, except level e_strict (E_strict'll be part of E_all as of PHP 6.0)
*/
function Unserialize_handler ($errno, $ERRSTR)//Custom functions
{
echo "Invalid serialized VALUE.N"; Output the specified content
}
$serialized = ' Foo '; Defining strings
Set_error_handler (' Unserialize_handler '); Set user custom error message functions
$original =unserialize ($serialized); To create a PHP value from a stored representation
Restore_error_handler (); Restore error message pointer
http://www.bkjia.com/PHPjc/632341.html www.bkjia.com true http://www.bkjia.com/PHPjc/632341.html techarticle PHP Tutorial Error Report Turn on detailed implementation definitions and usage error_reporting () set the error level for PHP and return to the current level. Syntax error_reporting (report_level) If the parameter level ...