PHP class scope: class not seen in included files
<p>I have a class...</p>

<pre><code>class myclass {}
$myclass = new myclass();
$myclass-&gt;frigin = 'awesome';
</code></pre>

<p>Later on in a <em>different</em> PHP file I have some includes...</p>

<pre><code>include('hippie_deflectors.php');
</code></pre>

<p>However the PHP in that includes does not see <code>$myclass</code> at all.</p>

<p>What is the simplest way to make PHP obey?</p>

<hr>

<p>This file...
<code>.com/[module]/requested_page.php</code></p>

<p>...has two includes which filter down the following top-to-bottom...</p>

<p><strong>Includes set 1</strong></p>

<hr>

<p><code>.com/system/header.php</code></p>

<p><code>.com/system/header_classes.php</code> [<code>$myclass</code> is defined here]</p>

<p><strong>Includes set 2</strong></p>

<hr>

<p><code>.com/[module]/index_get.php</code></p>

<p><code>.com/system/template_1.php</code></p>

<p><code>.com/system/includes_js.php</code></p>

<p><code>.com/system/scripts/onload.js</code> [<code>$myclass</code> undefined here]</p>
