<?php class Foo { public $c; public function __construct(callable $c) { $this->c = $c; } public function doCb() { ($this->c)(); } private static function bar() { var_dump(__METHOD__); } } $f = new Foo('Foo::bar'); // fine $f->doCb(); // not fine ($f->c)();
You have javascript disabled. You will not be able to edit any code.