Php constant-PHP5.3 why should E_USER_DEPRECATED be introduced? What is the difference between it and E_USER_WARNING?

Source: Internet
Author: User
The following line is displayed in a code: {code ...} check php. netmanuzherrorfunc. constants. the above two system constants exist in php. the functions seem to be the same. so what are their differences? E_DEPRECATED and E_USER_DEPRECATED are PHP5.3. you can see this line in a code:

// Define E_USER_DEPRECATED for PHP < 5.3.if (!defined("E_USER_DEPRECATED")) define('E_USER_DEPRECATED', E_USER_WARNING);

Look at the existence of the above two system constants in the http://php.net/manual/zh/errorfunc.constants.php. The function seems to be the same. So what is the difference between them?

E_DEPRECATED and E_USER_DEPRECATED are two new error levels in PHP 5.3. Does this indicate that we should take the new one first? Is it recommended to discard E_USER_WARNING?

Reply content:

See this line in a code:

// Define E_USER_DEPRECATED for PHP < 5.3.if (!defined("E_USER_DEPRECATED")) define('E_USER_DEPRECATED', E_USER_WARNING);

Look at the existence of the above two system constants in the http://php.net/manual/zh/errorfunc.constants.php. The function seems to be the same. So what is the difference between them?

E_DEPRECATED and E_USER_DEPRECATED are two new error levels in PHP 5.3. Does this indicate that we should take the new one first? Is it recommended to discard E_USER_WARNING?

WARNING and DEPRECATED have different meanings. We recommend that you first look up the dictionary to understand what they mean in English.

In this specific scenario, DEPRECATED indicates that the functions used are discarded. In general, it is recommended to use other methods in this document.
WARNING indicates a WARNING that may be generated due to incorrect usage. For example, a parameter with an incorrect format is passed.

Because E_USER_DEPRECATED is introduced in 5.3, you can define E_USER_DEPRECATED as E_USER_WARNING before 5.3. This is just a work und and does not mean they have the same meaning.

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.