Access a static variable by $var::$reference
- by chuckg
I am trying to access a static variable within a class by using a variable class name. I'm aware that in order to access a function within the class, you use call_user_func():
class foo {
function bar() { echo 'hi'; }
}
$class = "foo";
all_user_func(array($class, 'bar')); // prints hi
However, this does not work when trying to access a…