What's the best way to get the value of a static var on an unknown class? Silverstripe uses a pretty clever (albeit ugly) technique that looks something like:
$var = eval("return $className::\$my_var;");
But then in other places i see:
$var = $this->stat('my_var');
And still in other places, I see:
$class = new ReflectionClass('my_class');
$var = $class->getProperty('my_var');
Which is the preferred method? Are a lot of these legacy techniques to support older PHP versions? Seems like it should be the same every time.