PHP - Initialize instance of object within a constructor of a class, access within a static member
<p>I am using a framework to route my routes to controllers and their respective methods, however I am not sure how to initialize classes within the constructor and then access this via a static member of the same class.</p>

<pre><code>class Controller {

    static private $test = null;

    private function __construct(){

        #$this-&gt;test = new Test();
        self::$test = new Test();

    }

    public static function Index(){

        // rather than this
        #$test = new Test();
        #echo $test-&gt;greet();

        // something like this
        #echo self::$test-&gt;greet();

    }

}
</code></pre>