Turn Off Deprecated Errors in PHP 5.3

Turn off deprecated errors in PHP 5.3

You can do it in code by calling the following functions.

error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

or

error_reporting(E_ALL ^ E_DEPRECATED);

Turn off deprecated and strict errors when running tests

Working solution for me: Install this component:

composer require symfony/debug

And add this in AppKernel#init:

if ($this->debug ) {
Debug::enable(E_RECOVERABLE_ERROR & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED, false);
// ...

disabling deprecated errors

Figured it out. The third party code has custom error handler and apparently it's overriding anything you set with error_reporting(). When I commented out the set_error_handler() line, error_reporting() took effect.

Can't suppress deprecated warnings in php v5.3

Try it with a number: http://www.php.net/manual/en/errorfunc.constants.php

Everything but the two deprecateds would be 8191.

PS. It's possible the app/framework/website you're watching/editing/creating sets the error reporting level to E_ALL. If so, it doesn't matter what you set in php.ini, because it's overridden later.



Related Topics



Leave a reply



Submit