这个问题在这里已经有了答案:Callingclosureassignedtoobjectpropertydirectly(12个答案)关闭9年前。我有这样的php代码:classFoo{public$anonFunction;publicfunction__construct(){$this->anonFunction=function(){echo"called";}}}$foo=newFoo();//Firstmethod$bar=$foo->anonFunction();$bar();//Secondmethodcall_user_func($foo->anonFunction)