error_reporting(0);//关闭错误
error_reporting(E_ERROR,E_WARNING,E_PARSE);//报告Runtion错误
error_reporting(E_ALL);//报告所有错误
init_set('error_reporting',E_ALL);//等同于error_reporting(E_ALL);
error_reporting(E_ALL & ~E_NOTICE);//报告除了E_NOTICE之外的所有错误
本文介绍了在PHP中如何使用error_reporting函数及其相关配置来控制错误报告级别。通过不同的参数组合,可以实现只显示运行时错误、报告所有错误或忽略通知等不同需求。
error_reporting(0);//关闭错误
error_reporting(E_ERROR,E_WARNING,E_PARSE);//报告Runtion错误
error_reporting(E_ALL);//报告所有错误
init_set('error_reporting',E_ALL);//等同于error_reporting(E_ALL);
error_reporting(E_ALL & ~E_NOTICE);//报告除了E_NOTICE之外的所有错误
转载于:https://www.cnblogs.com/shangfz/p/11238069.html
2314

被折叠的 条评论
为什么被折叠?