If you need to add functions to an Object on the fly in PHP, here is a possible solution:
class MyClass
{publicfunction __call($m,$a){if(isset($this->$m)){$func=$this->$m;$func();}}}$test=new MyClass();$test->runtimeAddedFunction=function(){echo"It Works !";};$test->runtimeAddedFunction();