<?php class Foo { public function main() { $obj = Bar::get(); var_dump($obj); } } class Bar { public function get() { return new static; } } $foo = new Foo(); $foo->main();
You have javascript disabled. You will not be able to edit any code.