note 28181 modified in function.error-reporting by jsheets
| From: | jsheets@php.net | Date: | Sun, 05 Jan 2003 06:31:34 +0000 |
| Subject: | note 28181 modified in function.error-reporting by jsheets | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-41680@lists.php.net to get a copy of this message | ||
[Editor's Note]
Instead of using @ to suppress errors if the file does not exist you should do a conditional
include:
if (is_file("nosuchfile.php")) {
include_once("nosuchfile.php");
}
Note that when you use the @ to suppress the error of an include file that couldn'd be found,
like so:
@include("nosuchfile.php");
It also suppresses all the parse errors generated in "nosuchfile.php" if it does exist.
It took us a long time before we discovered why we weren't getting any parse errors... This is
it.
Personally, I don't like this... Maybe it can be changed in a future php version? :)
Coditor
--was--
Note that when you use the @ to suppress the error of an include file that couldn'd be found,
like so:
@include("nosuchfile.php");
It also suppresses all the parse errors generated in "nosuchfile.php" if it does exist.
It took us a long time before we discovered why we weren't getting any parse errors... This is
it.
Personally, I don't like this... Maybe it can be changed in a future php version? :)
Coditor
http://www.php.net/manual/en/function.error-reporting.php