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.