In addition to what Conrad Mayer mentioned in the PHP manual:
$fres = @fopen('file.ext','w+');
if($fres){
}
fopenreturns false on error. When an error is suppressed on fopen and you are not using it if($fres), subsequent file functions will cause an error, saying that $fresit is not a valid file descriptor.
source
share