stuartmarsh Posted October 19, 2008 Share Posted October 19, 2008 Does anyone know if there is a method equivalent of get_class($this)? So if the code is run from within the "testfunc" function, it would return "testfunc". Thanks. Link to comment https://forums.phpfreaks.com/topic/129101-solved-how-do-i-find-out-what-the-current-method-is/ Share on other sites More sharing options...
JasonLewis Posted October 20, 2008 Share Posted October 20, 2008 There are two magic constants that you can use. __METHOD__ #Also returns the name of the class __FUNCTION__ #Just returns the name of the current function Link to comment https://forums.phpfreaks.com/topic/129101-solved-how-do-i-find-out-what-the-current-method-is/#findComment-669868 Share on other sites More sharing options...
stuartmarsh Posted October 20, 2008 Author Share Posted October 20, 2008 MAGIC!! Those are just the things I was looking for. Thanks very much, you've just made my code that little bit easier. Link to comment https://forums.phpfreaks.com/topic/129101-solved-how-do-i-find-out-what-the-current-method-is/#findComment-669966 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.