Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 17
    This is incredible resource intensive. Using FUNCTION or METHOD is much more efficient. debug_backtrace() is great if you need more than just the function name though. Commented Nov 15, 2013 at 9:13
  • 2
    It's a bad practice to use debug_backtrace() for this purpose Commented Apr 15, 2014 at 18:11
  • 1
    THIS IS THE ONLY CORRECT WAY i have found !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!! !!!!!!!!!!!!!! because __FUNCTION__ returns parent function name (when the current function is included in parent function) Commented Apr 25, 2015 at 8:56
  • 5
    @tazo todua. can you give an example? Commented Feb 13, 2016 at 18:42