3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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());
based on BWGHA