PHP error_reporting () Setting Error reporting level

Source: Internet
Author: User
    1. * For now, avoid warnings of e_strict mode
    2. * (This must is done before function definitions)
    3. */
    4. if (defined (' e_strict ')) {
    5. $old _error_reporting = error_reporting (0);
    6. if ($old _error_reporting & e_strict) {
    7. Error_reporting ($old _error_reporting ^ e_strict);
    8. } else {
    9. Error_reporting ($old _error_reporting);
    10. }
    11. unset ($old _error_reporting);
Copy Code

The following are common:

    1. Turn off all error reporting;

    2. error_reporting (0);

    3. Report easy running errors; reporting a simple run error

    4. Error_reporting (E_error | e_warning | E_parse);

    5. Reporting E_notice can good too (to report uninitialized

    6. Variables or catch variable name misspellings ...); Includes spelling errors that report some uninitialized variables or catch variable names

    7. Error_reporting (E_error | e_warning | E_parse | E_notice);

    8. Report all errors except E_notice
    9. The default value set in php.ini; all errors are reported but not included E_notice

    10. Error_reporting (e_all ^ e_notice);

    11. Report All PHP errors (bitwise is used in PHP 3); reports all errors

    12. Error_reporting (E_all);

    13. Same as error_reporting (E_all); ibid.
    14. Ini_set (' error_reporting ', e_all);

Copy Code
  • 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.