note 28181 rejected from function.error-reporting by danbrown

From: Date: Fri, 24 Oct 2008 18:40:56 +0000
Subject: note 28181 rejected from function.error-reporting by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-145713@lists.php.net to get a copy of this message
Note Submitter: jjuffermans at chello dot com ---- [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

« previous php.notes (#145713) next »