fopen() error handling
<p>I'm working on a script at the moment that reads in an HTML template file, populates it with data and then saves the populated HTML file as a cached copy in my cache folder. </p>

<p>I'm having real difficulties evaluating whether an error has occured with fopen() whilst runtime errors are suppressed:</p>

<pre><code>$file = @fopen($location,"w+"); 

// manual states fopen() returns false on error
// though the below does not catch any errors 

if (!$file) {
    $this-&gt;doSomething();
}
</code></pre>

<p>Is the suppression working against me? I would really appreciate some insight into this. I have tried setting error_reporting to display no errors,</p>

<pre><code>ini_set('display_errors',0);
ini_set('log_errors',1);
error_reporting(E_ALL);
</code></pre>

<p>and removed the supression from fopen() but to no avail.</p>

<p>Thank you in advance!</p>
