Php error level, php error level

Source: Internet
Author: User
Tags parse error php error

Php error level, php error level

In the php programming process, you will surely encounter more or less error reminders. These error prompts guide us to write cleaner code. Today, we will first write the error types we listed, first, you need to dig a hole to learn about php errors and exceptions.

  • Deprecated: minimum error. The program continues to execute.

  • If a Notice notification-level error is reported directly using an undeclared variable, the program continues to execute

  • The expected result may not be returned due to an error at the Warning level.

  • Fatal error: Fatal error. The program is not executed.

  • Parse error Syntax Parsing error. The maximum error level does not display any other error information.

  • E_USER _ related errors related to user settings

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

How do I set the error level?

Error_reporting (-1)Show all errors,Error_reporting (0)Block all errors. Ini_set ('error _ report', 0) also shields all errors. You can set error_reporting in the php. ini file to display the script or not to display certain errors. Ini_set ('display _ errors ', 'on') displays an error.

  Note:Error_reporting () sets the errors reported, while ini_set ('display _ errors ', 'on') sets whether an error is returned. Therefore, error_reporting (-1) and ini_set ('display _ errors ', 0) can be used as the setting log: Reports errors and does not output them.

  

Example: error_reporting (E_ALL &~ E_NOTICE) do not display notification-level errors. "~" Indicates not.

 

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.