PHP中错误控制@运算符
来源:互联网 发布:微信小程序 源码下载 编辑:程序博客网 时间:2024/05/17 03:13
PHP支持一个错误控制运算符:at符号(@)。当添加在PHP中表达式之前时,任何错误消息都会被忽略。
如果你有一个自定义的错误处理函数set_error_handler()那它仍会被调用,但这个自定义错误处理程序可以(也应该)调用error_reporting(),当出发的错误之前有@符号,它将返回0。
如果track_errors功能启用时,任何错误消息将被保存在变量php_errormsg中。这个变量将对每个错误被覆盖,所以如果你想使用它要尽早检查。
原文:
PHP supports one error control operator: the at sign (@). When prepended to an expression in PHP, any error messages that might be generated by that expression will be ignored.
If you have set a custom error handler function with set_error_handler() then it will still get called, but this custom error handler can (and should) callerror_reporting() which will return 0 when the call that triggered the error was preceded by an @.
If the track_errors feature is enabled, any error message generated by the expression will be saved in the variable$php_errormsg. This variable will be overwritten on each error, so check early if you want to use it.
- PHP中错误控制@运算符
- 33. PHP 错误控制运算符
- PHP中的错误控制运算符
- php基本运算符,数组运算符,错误控制运算符及基础知识
- PHP - Manual手册 - 第 15 章 运算符 - 错误控制运算符
- PHP中运算符
- php运算符与流程控制 循环控制
- PHP中条件运算符
- PHP中算数运算符
- php中位运算符
- 29. PHP 错误控制
- PHP错误日志控制
- PHP学习之二:运算符与流程控制
- PHP自学过程之 运算符与流程控制
- (三)php运算符与流程控制
- php(3)——运算符、流程控制
- 【php 知识整理】(2) 运算符 & 流程控制
- php中逻辑运算符,字符串运算符
- HDU 1575 Tr A (矩阵快速幂)
- UVa 11375 Matches
- 230 - Borrowers
- 511 - Do You Know the Way to San Jose
- 822 - Queue and A
- PHP中错误控制@运算符
- 1593 - Alignment of Code
- 编程笔记_J2SE_LinkList&ArrayList&HashMap
- 1594 - Ducci Sequence
- 1595 - Symmetry
- 1596 - Bug Hunt
- 1597 - Searching the Web
- 1598 - Exchange
- 10391 - Compound Words