Q:

How do I call a static method of a class stored as a variable? 

Why, in a class instance context, don't calls of the form $this->className::staticMethod work, but calls of the form $className::staticMethod do work? 
In the example below callDoSomething2 works, but callDoSomething does not work (I get a parser error).  I'm using PHP version 5.3.15.  
<? php
class A {
    private $className;

    public function __construct($className) {
        $this->className = $className;
    }

    public function callDoSomething() {
        $this->className::doSomething();
    }

    public function callDoSomething2() {
        $className = $this->className;
        $className::doSomething();
    }
}

class B {
    public static function doSomething() {
        echo "hello\n";
    }
}

$a = new A('B');
$a->doSomething();

A:

callDoSomething2 is one way to do it, the other would be to use something along the lines of
call_user_func("{$this->className}::doSomething");

