I'm usually against using @
as it can cause lots of headaches. But look at this two examples:
a)
if(file_exists('file'))
unlink('file');
.
b)
@unlink('file');
.
It sounds like b
is causing less disk lookups, which is good for performance. So my question is: would option b
cause me any problem or has any disavantages in relation to a
?
I would just go for the first one.
What if the file couldn't be deleted because of another reason than simply the fact that the file doesn't exist?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With