[UPHPU] @include_once bad?

Joseph Scott joseph at josephscott.org
Fri Mar 27 08:45:14 MDT 2009


On Mar 26, 2009, at 11:07 PM, Wade Preston Shearer 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?


By definition an include_once failure is non-fatal, so if you just  
want to avoid getting the warning messages with out suppressing errors  
you can change the error reporting level with error_reporting().

As a general technique if I need to pull in a file I check it with  
is_readable() first.

--
Joseph Scott
joseph at josephscott.org
http://josephscott.org/






More information about the UPHPU mailing list