@unlink bad practice?

I'm usually against using @ , as this can cause a lot of headaches. But look at two examples:

 a) if(file_exists('file')) unlink('file'); 

.

 b) @unlink('file'); 

.

It seems that b causes less disk access, which is good for performance. So my question is: does option b cause me any problems or have any disadvantages with respect to a ?

+6
source share
1 answer

I would just go first.

What if the file cannot be deleted due to another reason than just the fact that the file does not exist?

+4
source

Source: https://habr.com/ru/post/905549/


All Articles