error_reporting()
error_reporting — Sets which PHP errors are reported
说明:
$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);
?>
常见的返回错误:
|
error_reporting()相关推荐
- php error_reporting 详解
error_reporting 设定错误讯息回报的等级. 语法: int error_reporting(int [level]); 传回值: 整数 函式种类: PHP 系统功能 内容说明 本函式用来 ...
- php error 关闭,php error_reporting()关闭报错
error_reporting(-1); 表示显示所有PHP错误报告,包括将来PHP加入的新的错误级别. 至PHP5.4,E_ALL有同样的行为. error_reporting(0); 表示关闭所 ...
- error_reporting笔记
1 <?php 2 /** 3 * ERROR_REPORTING 错误报告级别 4 * @author cntnn11 5 * @time 2013-01-14 6 */ 7 error_re ...
- ***PHP中error_reporting()用法详解(含codeigniter框架中屏蔽错误提示的解决方案)
php中我们对错误的处理会常用到error_reporting函数了,大家可以看到最多的是error_reporting(E_ALL ^ E_NOTICE)了,这个到底什么意思呢,下面我来来看看. e ...
- error_reporting()函数用法
首先要知道error_reporting()函数是用来设置错误级别并返回当前级别的.它有14个错误级别,如下: 1 E_ERROR 致命的运行时错误. 错误无法恢复过来 ...
- php e all e notic,error_reporting(E_ALL ^ E_NOTICE)详细说明 | 慢生活的记忆
error_reporting() 设置 PHP 的报错级别并返回当前级别.; 错误报告是按位的.或者将数字加起来得到想要的错误报告等级. ; E_ALL – 所有的错误和警告 ; E_ERROR – ...
- .ini文件中的PHP 5.6 error_reporting设置不起作用
环境: wamp+php5+mysql 问题描述:在本地调试php代码的时候,升级了php版本(5.5.12), 爆出大量WARNING, DEPRECATED,NOTICE提示. 第一次修改: 修改 ...
- PHP中error_reporting()用法详解
php中我们对错误的处理会常用到error_reporting函数了,大家可以看到最多的是error_reporting(E_ALL ^ E_NOTICE)了,这个到底什么意思呢,下面我来来看看. e ...
- PHP的display_errors与error_reporting
ini_set("display_errors")比error_reporting的级别高 <?php//设置报错的级别 error_reporting(E_ALL);//设 ...
最新文章
- python检查https过期_记录用certbot续签HTTPS时,python的pip源出现问题
- 【算法竞赛学习】金融风控之贷款违约预测-建模与调参
- Build 2018,给你带来全新的开发者体验, .NET Core 3.0带来桌面支持
- WINDOWS 如何关闭3306端口
- python支持向量机 股票_小蛇学python(4)利用SVM预测股票涨跌
- 视觉SLAM之词袋(bag of words) 模型与K-means聚类算法浅析
- 32位qt程序, 利用32位mysql驱动,连接64位mysql8.0
- 计算机系统盘怎么扩充,扩大c盘空间,小编教你如何扩大C盘空间
- 前端知识总结之浏览器知识
- Region Proposal by Guided Anchoring论文解读
- docker仓库的搭建居然只要一分钟!
- String Shifting
- 用户上传用户头像至服务器
- 苹果承认新一代iPad wifi问题 正调查原因
- 国外卫星地图 Sentinel Hub EO Browser的使用
- 2022年全球与中国医院信息系统(HIS)行业发展趋势及投资战略分析报告
- 郝健: github多人协作项目开发实操笔记
- 什么是memcache 及 php操作memcache基本操作
- 数组中find的用法
- 作为产品运营,如何培养自己的用户思维?