$obj = new stdClass;
$obj->hello = function() {
  return "Hello World\n";
};
echo $obj->hello();

こういう書き方出来ないですか?