PHP static variables memory usage
<p>I have been wondering for a while already how does static variables work regarding memory use and should that even be really considered?</p>

<p>I understand that static variables will only use up one area of memory, doesn't matter how many instances there are of the class itself. So in this sense, it should be wise to use static variables for wise memory consumption too, right? But I've never stumbled across anyone talking about the memory usage of static variables (only that you can share the data with different instances).</p>

<p>For example:</p>

<pre><code>class Something () {
    static $DB = null;
    __construct ($DB) {
        $this-&gt;DB = $DB;
    }
}
</code></pre>

<p>If I would create 10 instances of this class, then it would generate less memory usage, than with non-static $DB-variable, right?</p>

<p>And if it is so, is the effect so small, it doesn't really matter?</p>
