Php error reports enable detailed implementation. Php Tutorial error report enable detailed implementation definition and usage error_reporting () set the php error level and return the current level. Syntax: error_reporting (report_level) if the parameter level php Tutorial error report is enabled for detailed implementation
Definition and usage
Error_reporting () sets the php error level and returns the current level.
Syntax
Error_reporting (report_level) if the level parameter is not specified, the current error level will be returned. The following items are possible values of level.
*/
// Close all error reports
Error_reporting (0 );
// Only report 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 of php. ini.
Error_reporting (e_all ^ e_notice );
// Report all php errors
Error_reporting (e_all );
// The same effect as error_reporting (e_all). This setting also reports all php errors.
Ini_set ('error _ report', e_all );
/*
Value constant description
1 e_error fatal run-time errors. errors that can not be 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 shoshould only be generated by the parser
8 e_notice run-time notices. the script found something that might be an error, but cocould also happen when running a script normally
16 e_core_error fatal errors at php startup. this is like an e_error in the php core
32 e_core_warning non-fatal errors at php startup. this is like an e_warning in the php core
64 e_compile_error fatal compile-time errors. this is like an e_error generated by the zend scripting engine
128 e_compile_warning non-fatal compile-time errors. this is like an e_warning generated by the zend scripting engine
256 e_user_error fatal user-generated error. this is like an e_error set by the programmer using the php function trigger_error ()
512 e_user_warning non-fatal user-generated warning. this is like an e_warning set by the programmer using the php function trigger_error ()
1024 e_user_notice user-generated notice. this is like an 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 like an e_error but can be caught by a user defined handle (see also set_error_handler ())
8191 e_all all errors and warnings, except T level e_strict (e_strict will be part of e_all as of php 6.0)
*/
Function unserialize_handler ($ errno, $ errstr) // user-defined function
{
Echo "invalid serialized value. n"; // output the specified content
}
$ Serialized = 'foo'; // define a string
Set_error_handler ('unserialize _ handler'); // sets the user-defined error message function.
$ Original = unserialize ($ serialized); // Create a php value from a stored representation
Restore_error_handler (); // restore error message pointer
Enable the detailed implementation definition and usage of the fatal error report. error_reporting () sets the php error level and returns the current level. Syntax error_reporting (report_level) if the parameter level...