If you’re running PHP code on the server having latest version of PHP, and you’re using deprecated code of PHP. Then, you might get the error something like below:
Deprecated: Assigning the return value of new by reference is deprecated
Note: Errors code be different, but for deprecated error, the error will have Deprecated written.
So, for removing the deprecated errors while running new php versions, you can use following code on the top of the PHP file.
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
error_reporting(E_ALL ^ E_DEPRECATED);
This method is for WordPress. Use the code inside wp-config.php. Remeber to look at the file code first, because the code is already there, so don’t paste the code. Just add “true” or “false” for enabling/disabling the errors.