function a()
{
$data = new sample();

return $data;
}


$x = a();

$x->samplefunc();


こういうことがしたいんですが無理でしょうか?