How to Suppress Strict Standards Errors in PHP 5?

Patricia Arquette
Release: 2024-11-16 02:26:03
Original
248 people have browsed it

How to Suppress Strict Standards Errors in PHP 5?

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
Copy after login

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!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template