<?php class Foo { public $callable; public function do() { return ($this->callable)(); } } class Bar { public function __invoke() { echo 'DO IT'; } } $foo = new Foo; $foo->callable = new Bar; ($foo->callable)();
You have javascript disabled. You will not be able to edit any code.