Error level in PHP, PHP error level _php tutorial

Source: Internet
Author: User
Tags parse error php error

Error level in PHP, PHP error level


In the course of PHP programming, you will encounter more or less error reminders, it is these error hints, guide us to write cleaner code, today first write our main list of error types, first dig pits, write about PHP errors and anomalies related knowledge, slowly pits.

    • Deprecated lowest level error, program continues execution

    • Notice notification level errors such as using undeclared variables directly, the program continues execution

    • Warning Warning Level error, may not get the desired result

    • Fatal error fatal level error fatal level errors, program does not execute down

    • Parse error syntax parsing errors, highest level errors, and even other error messages are not rendered

    • E_user_ related error user settings related errors

  Use the Trigger_error () function to set a user-level error/warning/notice information

How do I set the error level?

error_reporting ( -1) shows all errors,error_reporting (0) masks all errors. Ini_set (' error_reporting ', 0) also masks all errors. You can set error_reporting in the php.ini file to cause the script to display or not display some errors. Ini_set (' display_errors ', ' on ') displays an error.

  Note:the error_reporting () setting reports what errors, while Ini_set (' display_errors ', ' on ') sets whether the output is incorrect. Thus error_reporting (-1) and Ini_set (' Display_errors ', 0) can be used as Setup logs: reports errors and does not output.

  

Example: error_reporting (e_all&~e_notice) does not display notification level errors. "~" means no.

 

http://www.bkjia.com/PHPjc/1048774.html www.bkjia.com true http://www.bkjia.com/PHPjc/1048774.html techarticle error level in PHP, PHP error level in the course of PHP programming, you are bound to encounter more or less error reminders, it is these error hints, guide us to write cleaner code ...

  • Related Article

    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.