I need to turn off E_STRICT. I have error_reporting = E_ALL & ~E_STRICT in my php.ini but it seems to be ignored. I tried this in my code:
ini_set('error_reporting', E_NOTICE);
Nothing!
Please help.
To turn off or disable error reporting in PHP, set the value to zero. For example, use the code snippet: <? php error_reporting(0); ?>
The quickest way to display all php errors and warnings is to add these lines to your PHP code file: ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);
try this.
error_reporting(E_ALL ^ E_STRICT);
This will report all errors except E_STRICT
If you've got your own error handler (search your code for set_error_handler
), then the error_reporting
config value will be ignored:
It is important to remember that the standard PHP error handler is completely bypassed for the error types specified by error_types unless the callback function returns FALSE. error_reporting() settings will have no effect and your error handler will be called regardless - however you are still able to read the current value of error_reporting and act appropriately. Of particular note is that this value will be 0 if the statement that caused the error was prepended by the @ error-control operator.
http://php.net/manual/en/function.set-error-handler.php
Also removing E_STRICT
from the error_reporting
config could fail, if the error occurs in the same file where error_reporting(...)
(or ini_set('error_reporting, ...')
) is called.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With