数码资讯
讨论PHP错误信息捕获方法的详细解决方案
PS: 1。捕获PHP语法错误 2。严重的错误 两类错误不能正常set_error_handle捕获,这是捕捉这种错误的技巧 复制代码代码如下所示: / / test.php页 (0)error_reporting; register_shutdown_function('pageonshutdow
选购提示
关注价格、性能、续航、售后和真实使用场景,理性比较后再下单。
PS:
1。捕获PHP语法错误
2。严重的错误
两类错误不能正常set_error_handle捕获,这是捕捉这种错误的技巧
复制代码代码如下所示:
/ / test.php页
(0)error_reporting;
register_shutdown_function('pageonshutdown);
包括('error_test。php);
PageOnShutdown()函数
{
味精= error_get_last(美元);
print_r($味精);
}
/ / error_test.php页
$ = 1 + 2
$
然后输出test.php打印
阵列({ } { } = >消息类型4 = >解析错误{文件} = D:网络 TBC error_test.php {线} = 5)
可以通过获得MSG来编写日志操作。
1。捕获PHP语法错误
2。严重的错误
两类错误不能正常set_error_handle捕获,这是捕捉这种错误的技巧
复制代码代码如下所示:
/ / test.php页
(0)error_reporting;
register_shutdown_function('pageonshutdown);
包括('error_test。php);
PageOnShutdown()函数
{
味精= error_get_last(美元);
print_r($味精);
}
/ / error_test.php页
$ = 1 + 2
$
然后输出test.php打印
阵列({ } { } = >消息类型4 = >解析错误{文件} = D:网络 TBC error_test.php {线} = 5)
可以通过获得MSG来编写日志操作。
声明:本文内容用于数码产品信息整理与选购参考,具体价格、库存、售后政策以官方渠道和电商页面实时信息为准。