Call to member function on a non-object
<p>I've read several of the threads that already exist with this, or a similar, name. None seems to address my situation exactly.</p>

<p>I'm getting this error from my <code>utils.php</code> class.</p>

<pre><code>Notice: Undefined variable: debug in /app/www/utils.php on line 89 Fatal error: Call to a member function debug() on a non-object in /app/www/utils.php on line 89
</code></pre>

<p>I define the variable <code>debug</code> like this:</p>

<pre><code>require_once('PHPDebug.php');
$debug = new PHPDebug();
</code></pre>

<p>and then call it (in line 89) like this:</p>

<pre><code>$debug-&gt;debug($message);
</code></pre>

<p>The reason I'm so baffled is that I copied and pasted these lines from my <code>index.php</code> and that call works just fine.</p>

<p>If you want, I can include links to the <code>index.php</code> and <code>utils.php</code> files, as well as <code>PHPDebug.php</code>.</p>
