note 34389 added to language.operators.errorcontrol
| From: | john-at-n0-spam-foobar-dot-nl at rack1 dot php dot net | Date: | Fri, 25 Jul 2003 15:04:19 +0000 |
| Subject: | note 34389 added to language.operators.errorcontrol | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-52642@lists.php.net to get a copy of this message | ||
With set_error_handler() you bypass the standard error handler, which takes care of @.
if (!($fp = @fopen('not_a_file', 'r')))
trigger_error("Can't open file!", E_USER_WARNING);
... generates ...
Warning: fopen("not_a_file", "r") - No such file or directory in index.php on
line 19.
User Warning : Can't open file! in index.php on line 20.
... when I use my own error handler. With the standard error handler I only get the second warning.
If someone knows how to use @ with your own error handler, let me know.
----
Manual Page -- http://www.php.net/manual/en/language.operators.errorcontrol.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34389
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34389&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34389&report=yes