error_reporting — Sets which PHP errors are reported

说明:

int error_reporting ([ int $level ] )

The error_reporting() function sets the error_reporting directive at runtime. PHP has many levels of errors, using this function sets that level for the duration (runtime) of your script. If the optional level is not set, error_reporting() will just return the current error reporting level.

参数:

The new error_reporting level. It takes on either a bitmask, or named constants. Using named constants is strongly encouraged to ensure compatibility for future versions. As error levels are added, the range of integers increases, so older integer-based error levels will not always behave as expected. The available error level constants and the actual meanings of these error levels are described in the predefined constants.

返回值:

Returns the old error_reporting level or the current level if no level parameter is given.

范例:

<?php

// Turn off all error reporting
error_reporting(0);

// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);

// Reporting E_NOTICE can be good too (to report uninitialized
// variables or catch variable name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);

// Report all PHP errors (see changelog)
error_reporting(E_ALL);

// Report all PHP errors
error_reporting(-1);

// Same as error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);

?>

常见的返回错误:

Value Constant  
1 E_ERROR
2 E_WARNING
4 E_PARSE
8 E_NOTICE
16 E_CORE_ERROR
32 E_CORE_WARNING
64 E_COMPILE_ERROR
128 E_COMPILE_WARNING
256 E_USER_ERROR
512 E_USER_WARNING
1024 E_USER_NOTICE
2048 E_STRICT
4096 E_RECOVERABLE_ERROR
8192 E_DEPRECATED
16384 E_USER_DEPRECATED

error_reporting()相关推荐

  1. php error_reporting 详解

    error_reporting 设定错误讯息回报的等级. 语法: int error_reporting(int [level]); 传回值: 整数 函式种类: PHP 系统功能 内容说明 本函式用来 ...

  2. php error 关闭,php error_reporting()关闭报错

    error_reporting(-1); 表示显示所有PHP错误报告,包括将来PHP加入的新的错误级别. 至PHP5.4,E_ALL有同样的行为. error_reporting(0);  表示关闭所 ...

  3. error_reporting笔记

    1 <?php 2 /** 3 * ERROR_REPORTING 错误报告级别 4 * @author cntnn11 5 * @time 2013-01-14 6 */ 7 error_re ...

  4. ***PHP中error_reporting()用法详解(含codeigniter框架中屏蔽错误提示的解决方案)

    php中我们对错误的处理会常用到error_reporting函数了,大家可以看到最多的是error_reporting(E_ALL ^ E_NOTICE)了,这个到底什么意思呢,下面我来来看看. e ...

  5. error_reporting()函数用法

    首先要知道error_reporting()函数是用来设置错误级别并返回当前级别的.它有14个错误级别,如下: 1        E_ERROR          致命的运行时错误. 错误无法恢复过来 ...

  6. php e all e notic,error_reporting(E_ALL ^ E_NOTICE)详细说明 | 慢生活的记忆

    error_reporting() 设置 PHP 的报错级别并返回当前级别.; 错误报告是按位的.或者将数字加起来得到想要的错误报告等级. ; E_ALL – 所有的错误和警告 ; E_ERROR – ...

  7. .ini文件中的PHP 5.6 error_reporting设置不起作用

    环境: wamp+php5+mysql 问题描述:在本地调试php代码的时候,升级了php版本(5.5.12), 爆出大量WARNING, DEPRECATED,NOTICE提示. 第一次修改: 修改 ...

  8. PHP中error_reporting()用法详解

    php中我们对错误的处理会常用到error_reporting函数了,大家可以看到最多的是error_reporting(E_ALL ^ E_NOTICE)了,这个到底什么意思呢,下面我来来看看. e ...

  9. PHP的display_errors与error_reporting

    ini_set("display_errors")比error_reporting的级别高 <?php//设置报错的级别 error_reporting(E_ALL);//设 ...

最新文章

  1. python检查https过期_记录用certbot续签HTTPS时,python的pip源出现问题
  2. 【算法竞赛学习】金融风控之贷款违约预测-建模与调参
  3. Build 2018,给你带来全新的开发者体验, .NET Core 3.0带来桌面支持
  4. WINDOWS 如何关闭3306端口
  5. python支持向量机 股票_小蛇学python(4)利用SVM预测股票涨跌
  6. 视觉SLAM之词袋(bag of words) 模型与K-means聚类算法浅析
  7. 32位qt程序, 利用32位mysql驱动,连接64位mysql8.0
  8. 计算机系统盘怎么扩充,扩大c盘空间,小编教你如何扩大C盘空间
  9. 前端知识总结之浏览器知识
  10. Region Proposal by Guided Anchoring论文解读
  11. docker仓库的搭建居然只要一分钟!
  12. String Shifting
  13. 用户上传用户头像至服务器
  14. 苹果承认新一代iPad wifi问题 正调查原因
  15. 国外卫星地图 Sentinel Hub EO Browser的使用
  16. 2022年全球与中国医院信息系统(HIS)行业发展趋势及投资战略分析报告
  17. 郝健: github多人协作项目开发实操笔记
  18. 什么是memcache 及 php操作memcache基本操作
  19. 数组中find的用法
  20. 作为产品运营,如何培养自己的用户思维?

热门文章

  1. C++中的override关键字
  2. C++中函数参数的默认值
  3. 电路原理邱关源_看高手是如何学习电路原理的,有哪些捷径?
  4. java中队列链表栈的作用_Java用链表实现栈和队列
  5. 易语言 mysql 卡死_易语言操作MYsql 所有课程停发
  6. 贷款违约预测--赛题理解
  7. Python 画樱花(动态画+飘落效果+暗色效)
  8. C++ close()关闭文件方法详解
  9. 3d查看器无法加载三维模型_珠峰登顶成功,送套三维模型给你
  10. 在有序旋转数组中找到最小值