how to find what file/object/line is calling a method?
Moderator: General Moderators
how to find what file/object/line is calling a method?
Some process is calling a method in a class, and I'm not sure which one it is. Is there a way to find out what exactly is running the method?
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
Re: how to find what file/object/line is calling a method?
You could use __LINE__ and __FILE__.
-
Mark Baker
- Forum Regular
- Posts: 710
- Joined: Thu Oct 30, 2008 6:24 pm
Re: how to find what file/object/line is calling a method?
Quite useful! Wasn't aware of this function... even though I'm not the OP, thank youMark Baker wrote:have a look at debug_backtrace()