PHP Constants-Why should PHP 5.3 introduce e_user_deprecated? What's the difference with e_user_warning?

Source: Internet
Author: User
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);

There are two system constants at the same time in http://php.net/manual/zh/errorfunc.constants.php. function seems to be the same. What difference do they have?

E_deprecated and e_user_deprecated are two new error levels in PHP 5.3, does it mean 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);

There are two system constants at the same time in http://php.net/manual/zh/errorfunc.constants.php. function seems to be the same. What difference do they have?

E_deprecated and e_user_deprecated are two new error levels in PHP 5.3, does it mean that we should take the new one first? Is it recommended to discard e_user_warning?

WARNING and DEPRECATED have different semantics, it is recommended to check the dictionary first to find out what they mean in English.

Returning to this specific scenario, DEPRECATED indicates that the functionality used is deprecated, and it is usually written in a document that suggests a different way to do it.
WARNING indicates a warning, such as a parameter that passed the wrong format, because of possible incorrect usage.

Since e_user_deprecated was introduced in 5.3, e_user_deprecated can be defined as e_user_warning before 5.3, which is only a workaround and does not mean the same thing.

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