How to Disable Strict Standards Error in PHP 5
In PHP, strict standards errors can be encountered when using certain coding practices or features that are considered outdated or discouraged. While it's generally beneficial to adhere to these standards for code quality and efficiency, there may be situations where you need to disable strict standards error reporting.
Solution:
To disable strict standards error reporting in PHP 5, use the ini_set() and error_reporting() functions as follows:
ini_set('display_errors', '0'); // Disable displaying errors to the user error_reporting(E_ALL | E_STRICT); // But still log errors
By setting display_errors to '0', PHP will no longer output strict standards errors to the user. However, it's important to note that errors will still be logged. You can use the error_log directive to specify where you want the errors to be recorded.
The above is the detailed content of How to Suppress Strict Standards Errors in PHP 5?. For more information, please follow other related articles on the PHP Chinese website!