Setting one global instead of in every function?
<p>As it is right now, i have my class system to be embedded in my core class. So i call my classes as such:</p>

<pre><code>$cms-&gt;userClass-&gt;function();
</code></pre>

<p>But this means that for every function i have in my userClass, i constantly need to add:</p>

<pre><code>global $cms;
</code></pre>

<p>To be able to access the database class as such:</p>

<pre><code>$cms-&gt;db-&gt;function();
</code></pre>

<p>Is there any way to set a global for the whole class, instead of having to define it at the start of every function?</p>
