<?php class B { public $c=12; } class A { function __construct() { $this->va = function() { return new B; }; } } $o=new A; var_dump($o); var_dump(($o->va)());
You have javascript disabled. You will not be able to edit any code.