PHP supports an error control operator: @. Any error messages that may be generated by the expression are ignored until it is placed in a PHP expression.
If an attribute is activated, any error information generated by the expression is stored in the variable $php _errormsg. This variable is overwritten every time an error occurs, so check it out as soon as possible if you want to use it.
<?php/* Intentional File Error */$my _file = @file (' non_existent_file ') or Die ("Failed opening file:error is ' $p Hp_errormsg ' ");//This works for any expression, not just functions: $value = @ $cache [$key];//would not issue a notice if T He index $key doesn ' t exist.? >
Note: The @ operator is only valid for an expression. A simple rule for beginners is that if you can get a value from somewhere, you can precede it with the @ operator. For example, you can put it in variables, functions and include () calls, constants, and so forth. It cannot be placed before the definition of a function or class, nor can it be used for conditional structures such as if and foreach.
Warning
The current "@" error control operator prefix even invalidates the fatal error report that caused the script to terminate. This means that if "@" is used to suppress the error message before a function call that does not exist or is of the wrong type, the script will die there without any indication of why.
Http://blog.sina.com.cn/s/blog_1603d3c730102wgz8.html
Http://blog.sina.com.cn/s/blog_1603d3c730102wgz9.html
Http://blog.sina.com.cn/s/blog_1603d3c730102wgza.html
Http://blog.sina.com.cn/s/blog_1603d3c730102wgzb.html