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
How to Send a Image to a PHP File Using Swift
Protection Against Xss Exploits
Can't Install PHPunit via Pear, Requires Pear Installer >= 1.9.2, Can't Upgrade Pear from 1.9.0
Return Multiple Response Data in One Response
How to Do Multiple SQL Statements in One MySQL_Query
How to Escape Single-Quote (Apostrophe) in String Using PHP
Avoid Public Folder of Laravel and Open Directly the Root in Web Server
How to Access a Property of an Object (Stdclass Object) Member/Element of an Array
Category Hierarchy (Php/Mysql)
PHP Generated Xml Shows Invalid Char Value 27 Message
Algorithm to Get All Possible String Combinations from Array Up to Certain Length
Special Characters in Fpdf with PHP
Deny Ajax File Access Using Htaccess
How to Replace All Xhtml/HTML Line Breaks (<Br>) with New Lines
PHP Preg_Match (.*) Not Matching Past Line Breaks
How to Access JSON Decoded Array in PHP
What Is the Advantage of Using Try {} Catch {} Versus If {} Else {}