test(function(Test $t) {
return $t->setQ('news');
});
function test(\Closure $closure)
{
if($closure instanceof \Closure) {
$clousure(new Test());
}
}
class Test {
public $q = 'test';
public function getQ() {
return $q;
}
public function setQ($new) {
$this->q = $new;
}
}