如何在PHP中使用方法名称作为参数
答
使用魔法不断功能
function foo(){
bar(__FUNCTION__);
}
Additionall使用
__METHOD__ to get the name of a method
你会意识到,一个方法需要一个对象,对不对? – 2012-02-07 02:19:25
你的意思是一个函数,而不是一个正确的方法?一个方法基本上是一个功能,它是一个对象的一部分 – 2012-02-07 02:20:14