When PHP runs, Notice: Useofundefinedconstantassumed appears.

Source: Internet
Author: User
When running PHP, Notice: Useofundefinedconstantassumed is prompted by PHP instead of an error. PHP can be directly used without declaring the variable in advance, but a prompt will be prompted if the variable is not declared. Generally, when a website is a formal website, it will turn off the prompt and even the error message. How can this problem be solved? 1. Disable PHP

When running PHP, Notice: Use of undefined constant assumed is prompted by PHP instead of an error. PHP can be directly used without declaring the variable in advance, but a prompt will be prompted if the variable is not declared. Generally, when a website is a formal website, it will turn off the prompt and even the error message. How can this problem be solved? 1. Disable PHP

PHP runningNotice: Use of undefined constant assumed
These are the prompts of PHP, rather than the error. PHP itself does not need to be notified in advance.Declare VariablesYou can use it directly, but there will be a prompt for undeclared variables. In general, as a formal website, the system will turn off the prompts or even connectError MessageIt is also disabled.
How can this be solved?
1,PHP disabling promptMethod

Search php. ini: phpnow with php-apache2handler.inierror_reporting = E_ALL changed to: error_reporting = E_ALL &~ E_NOTICE

2. Add each file header

error_reporting(0);

Original article address: Notice: Use of undefined constant assumed appears during PHP running. Thank you for sharing it with the original author.

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.