Debug PHP Function Calls
Logging errors can be very helpful as your code base becomes huge. But sometime it’s still difficult to find out what’s calling the function that’s giving the error. Wouldn’t it be nice if there was a way to see how you’d got to that function?
Well of course there’s a way in PHP – debug_backtrace. Just add something similar in a suitable place in your code and you’ll be able to find what functions were called.
$trace=debug_backtrace();
$caller = $trace[1]['function'];
// or just dump all the info
var_dump($trace);
Blog Categories
Recent Stuff
Similar Posts
Twitter Updates
- Working on 3G this morning via tethered ICS. Thank goodness for VPN and RDP among other acronyms
- RT @rmi: Competition is something that happens to people who can't afford to buy government. It doesn't affect telcos.
- We're new in the "Glen" but just found the local chippy is great. And downpour waited until we were driving home from picnic dinner. Nice
- @daihenwood I've got an older Nexus S with ICS. iPhone seems criplled now. Recommend a Google native experience cmpd to Galaxy S2,etc
- RT @AnonyOps: #Germany protests, #Greece burns, #Syria bleeds. #America watches the #Grammys.


