在PHP中,如果方法foo()调用方法bar($ name),是否可以将其方法名称(即'foo')作为参数传递?
Use magic constant FUNCTION
function foo(){
bar(__FUNCTION__);
}
Additionall use
__METHOD__ to get the name of a method
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.