Home >Backend Development >PHP Tutorial >How Can I Disable Strict Standards Error Reporting in PHP 5?

How Can I Disable Strict Standards Error Reporting in PHP 5?

Barbara Streisand
Barbara StreisandOriginal
2024-11-26 04:32:08731browse

How Can I Disable Strict Standards Error Reporting in PHP 5?

Disabling Strict Standards Error Reporting in PHP 5

To disable error reporting for strict standards, you can use the following code:

ini_set('display_errors', '0');
error_reporting(E_ALL | E_STRICT);

The ini_set() function sets the display errors option to '0', which prevents the user from seeing error messages. The error_reporting() function sets the error reporting level to include strict standards errors, but they will not be displayed.

Instead, they will be logged to the standard system log or a specified location set using the error_log directive. This allows you to log errors without interrupting the user's experience.

The above is the detailed content of How Can I Disable Strict Standards Error Reporting in PHP 5?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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