Is there a way to get information on a file and line # where a call to a specific function was made?
In other words, say I have the function Foo() in class Bar. In the file test.php, it calls Bar::Foo() on line 15. I want to be able to, in the function Foo(), say "Ok, I was called from test.php on line 15".
Just wondering. I know I can pass this information to the function, just wondering if there was a quicker and more efficient method.
Get called-from informaiton
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
debug_backtrace() has all the details of the call stack. 