And I quote:
"Error suppression is slow. This is because PHP dynamically changes
error_reporting to 0 before executing the suppressed statement, then
immediately changes it back. This is expensive."

Using error suppression is always a bad thing. It makes debugging in the
future much more difficult. If you want to include only files that exist
just wrap it in an if ( file_exists($file) ). This makes the code much more
clearer and you don't sacrifice missing other potential errors that
include_once might throw.

-Kevin-

On Thu, Mar 26, 2009 at 11:07 PM, Wade Preston Shearer <
[email protected]> wrote:

> Is there anything improper about using @include_once() for files that may
> not exist (suppressing the error)? Would it be more proper to remove the @
> and wrap the include in an is_readable() to verify that the file exists and
> is readable first?
>
> _______________________________________________
>
> UPHPU mailing list
> [email protected]
> http://uphpu.org/mailman/listinfo/uphpu
> IRC: #uphpu on irc.freenode.net
>

_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to