略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: 错误报告

2024-04-24

错误报告

自 PHP 5 起引进了新常量 E_STRICT,其值为 2048。它提供了对用户代码的协同性和向前兼容性的运行时 PHP 建议,有助于使用户保持最新和最好的编程风格。例如在使用已过时的函数时 STRICT 信息会提出警告。

Note: E_ALL 不包括 E_STRICT,因此其默认未激活。

add a note add a note

User Contributed Notes 2 notes

up
19
Anonymous
6 years ago
According to the notes in the php.ini file, E_ALL *does* include E_STRICT; to exclude it you would use E_ALL & ~E_STRICT

This may be useful for someone who has upgraded and kept their old php.ini
up
-11
Anonymous
11 years ago
To enable full error reporting (recommended for development boxes) use:

use error_reporting(E_ALL | E_STRICT);

or in php.ini:

error_reporting  =  E_ALL | E_STRICT

官方地址:https://www.php.net/manual/en/migrating5.errorrep.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3