title: Call callback stored as member variable
body: <p>Is it possible with php to directly call a callback stored in an member variable of a class? currently I'm using a workaround, where I'm temporarily storing my callback to a local var.</p>
  
  <pre><code>class CB {
    private $cb;
    public function __construct($cb) {
      $this-&gt;cb = $cb;
    }
    public function call() {
      $this-&gt;cb(); // does not work
      $cb = $this-&gt;cb;
      $cb(); // does work
    }
  }
  </code></pre>
  
  <p>php complains that <code>$this-&gt;cb()</code> is not a valid method, i.e. does not exist.</p>