The default settings notice_php tutorial for masking notice warnings in PHP default settings

Source: Internet
Author: User

The default setting for blocking notice warnings in PHP default settings notice


The default setting for PHP is to display the notice warning prompt, which causes the page to not display properly. You have a variable that is not defined and is used directly. However, when compiling PHP is not as strict as C + +, when programming often use this feature.
When you deploy your hard-worked PHP program to the server, it's a hint that many people have seen:

PHP notice:undefined Variable  

Look, you have a variable that is not defined and is used directly. However, when compiling PHP is not as strict as C + +, when programming often use this feature. The default setting for PHP is to display these prompts, which will cause the page to not display properly.

Error_reporting (E_all);  

The first one is to represent all errors,
The second delegate shows that all errors do not show a warning,
We just put the second line in front of the//, the first line in front of//remove it.

Attached: detailed report of individual error reports
How to use:

error_reporting (0);//Disable error Reporting  error_reporting (e_all ^ e_notice);//Display all error messages except E_notice error_reporting  (e_ All^e_warning^e_notice)//displays all error messages except e_warning e_notice  error_reporting (E_error | e_warning | E_parse);//Display run-time errors with error_reporting (e_all ^ e_notice);  

http://www.bkjia.com/PHPjc/1133118.html www.bkjia.com true http://www.bkjia.com/PHPjc/1133118.html techarticle The default setting for blocking notice warnings in PHP default settings notice PHP is to display the notice warning prompt, which causes the page to not display properly. Do you have an undefined change ...

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