Hasin Hayder from Developer Tutorials wrote this neat post about using debug_backtrace. It could help you debug your code more efficiently and save you hours of dumping variables and testing functions, not to mention saving you from pulling your hair out. I myself used it a couple of times when writing class files and such, it helps you read the code a little better too. Go ahead and check out his post and leave a comment.

Debugging PHP code using debug_backtrace