Accessing static variable in quotes from inside static function
<p>I have the following piece of code, which doesn't work:</p>

<pre><code>&lt;?php
class test{
    public static $var = 'foo';
    public static function printvar(){
        echo "Var value is {self::$var}";
    }
}
test::printvar();
?&gt;
</code></pre>

<p>However this works:</p>

<pre><code>&lt;?php
class test{
    public static $var = 'foo';
    public static function printvar(){
        echo "Var value is " . self::$var;
    }
}
test::printvar();
?&gt;
</code></pre>

<p>Question is, is there anyway I can access the static variables inside quotes from inside a static method?</p>
