Php error report enabling detailed implementation

Source: Internet
Author: User
Definition and usage: error_reporting (). set the php error level and return the current level. Syntax: error_reporting (report_level) if the level parameter is not specified, when

Definition and usage:Error_reporting (), set the php error level and return 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.

Disable all error reports: error_reporting (0 );

Only running errors are reported: 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 );

Similar to error_reporting (e_all), this setting also reports all php errors: ini_set ('error _ report', e_all );

  1. Function unserialize_handler ($ errno, $ errstr) // user-defined function
  2. {
  3. Echo "invalid serialized value. n"; // output the specified content
  4. }
  5. $ Serialized = 'foo'; // define a string
  6. Set_error_handler ('unserialize _ handler'); // sets the user-defined error message function.
  7. $ Original = unserialize ($ serialized); // Create a php value from a stored representation
  8. Restore_error_handler (); // restore error message pointer

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.