I have the following piece of code, which doesn’t work:
<?php
class test{
public static $var = 'foo';
public static function printvar(){
echo "Var value is {self::$var}";
}
}
test::printvar();
?>
However this works:
<?php
class test{
public static $var = 'foo';
public static function printvar(){
echo "Var value is " . self::$var;
}
}
test::printvar();
?>
Question is, is there anyway I can access the static variables inside quotes from inside a static method?
By manual:
Read more string …