PHP Objects broken, $this is undefined
<p>The code:</p>

<pre class="lang-php prettyprint-override"><code>&lt;?php

class My_Test{

    public $exists = 'yah';

    public function test(){
            return $this-&gt;exists;
    }

}

$test = new My_Test;
echo $test-&gt;test();
</code></pre>

<p>produces the following error intermittently (every other page request on average) on two servers:</p>

<pre><code>( ! ) Notice: Trying to get property of non-object in test.php on line 8
Call Stack
#   Time    Memory  Function    Location
1   0.0003  636392  {main}( )   ../test.php:0
2   0.0003  636840  My_Test-&gt;test( )    ../test.php:14
</code></pre>

<p>where line 10 is `return $this->exists;</p>

<p>Please note this is not an untested example, it is the full code that produces the error. I'm aware the code is valid but it doesn't work in two environments.</p>

<p>I'm really not sure why! One server is running PHP 5.3.3 (fedora), the other PHP 5.3.2 (ubuntu). I've tried rebooting the servers too. They don't share anything, although they are on the same network.</p>

<p>Anyone got any tips for debugging?</p>
