Dynamically Load Class and Access Static Variable in PHP <= 5.2
<p><strong>Edit:</strong></p>

<p><strong>I solved it by getting all of the class variables using get_class_vars(), and then just acquired the correct property from that array, if it existed. Seems simple enough to me; if anyone has a different solution, I'd love to hear it (or read it, I guess..) :)</strong></p>

<p>I'm trying to access a static variable in a dynamically-loaded class as follows:</p>

<pre><code>$file::$disabled
</code></pre>

<p>(In the above statement, $file obviously references the name of a class, and $disabled is the static variable I want to access within the class.)</p>

<p>On PHP 5.3, this works fine; as a result of running the above code on lower versions, I get the infamous T_PAAMAYIM_NEKUDOTAYIM error.</p>

<p>How I've usually gotten around this error when working with older versions of PHP is to create a getter function for that variable and get that return value with call_user_func(). However, for ease of use of developers who will be adopting this code, I would like to keep $disabled as a simple variable rather than a function.</p>

<p>I've tried eval() on the statement, only to reach another dead end.</p>

<p>Does anybody know how I can make this happen?</p>
