<?php class Model { } class Factory { public function create() { return new Model; } } $factory = new Factory; $callable = array($factory, 'create'); $model = $callable(); var_dump($model);
You have javascript disabled. You will not be able to edit any code.