if(!$tfile=@opendir("themes/$t_cookie[9]"))

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
sutejok
Forum Commoner
Posts: 37
Joined: Wed Mar 24, 2004 4:08 pm

if(!$tfile=@opendir("themes/$t_cookie[9]"))

Post by sutejok »

I found this line in one of the PHP nuke files.
Can anyone tell me what is it checking?

if(!$tfile=@opendir("themes/$t_cookie[9]"))

and what is that =@ operator?

thx...
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

@ supresses errors, so that line is trying to open a directory, if it can't open it for whatever reason then the error is supressed, ie you won't see it. If you removed the @ and the opendir failed, you'de see the error message it produced.

I've never once used @ in any functions, imho they should be handled 'nicely' i.e using things like file_exists() and is_readable() before atempting to open files/directories :o
Post Reply