Question: I have a PHP script that stops processing (it seems to be) on a PHP warning. The error is general "PHP Warning: fopen" - "failed to open stream: No such file or directory".

Should PHP stop here? I thought only on fatal errors?

Is there a way to get it to continue?

Answer: 
[As noted on the php documentation page](http://us3.php.net/manual/en/function.fopen.php),

> 
> If the open fails, an error of level E\_WARNING is generated. You may use @ to suppress this warning. 
> 
> 
>
In addition to what Conrad Meyer has mentioned from the PHP manual:

```
$fres = @fopen('file.ext','w+');
if($fres){
  // so anything you want with the file
}

```

`fopen` returns false on error. When there's an error suppressed on fopen and you do not use the `if($fres)`, the subsequent file operation functions will throw error saying that `$fres` is not a valid file handle.