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