Error Control Operators
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 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.
/* Intentional file error */
$my_file = @file ('non_existent_file') or
die ("Failed opening file: error was '$php_errormsg'");
// this works for any expression, not just functions:
$value = @$cache[$key];
// will not issue a notice if the index $key doesn't exist.
?>
http://tw.php.net/manual/tw/language.operators.errorcontrol.php
留言列表