Every now and then I discover something that makes me feel like I’ve been doing things the hard way. The feeling is an interesting combination of excitement and embarrassment. I experienced this today while browsing PHP documentation. I discovered two function that will make my life a lot easier in the future: debug_backtrace and debug_print_backtrace. As someone who has written his fair share of Java, I’m very accustomed to stack traces. The fact I’ve made it as far as I have with PHP without them leaves me feeling amazed. The fact that I’ve had access to them all along leaves me feeling ashamed.
I guess you learn something new everyday.
Oh, that’s a really neat function. When developing I used to always echo “Here: SomethingUnique”.
I do this all the time, I’m always fascinated by what people choose to echo out when debugging that way. “here1″, “here2″, “ugh”, “f— this” are my favorites haha