I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
which meant I could use <space>dump to dump a variable regardless of the current state of the output buffering, and <space>back to give me a simplified backtrace. Why couldn't I just print out debug_backtrace(), I hear you ask? Because PHP usually dies when you do that, because recursive calls cause the process to run out of memory while trying to print your debugging message. Yes.
When that wasn't enough, and I couldn't step through with a debugger (happens more than you'd expect) I wrote my own entire backtrace/debug module which shows you context, lets you click through to bitbucket or github or wherever the code is, lets you open each line in your local editor, gives info about VCS branches, PHP versions, that sort of thing. I had to use a lot of hacks to get it to work because PHP is so unfriendly towards debugging. But it does clever things like detecting if the exception was from PDO and printing the faulting SQL. I was quite pleased with that.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yeah. Especially with PHP, where exceptions and error handling were apparently designed by some kind of moustache-twirling Disney villain.
I started off by adding this to my Vim config:
which meant I could use
<space>dump
to dump a variable regardless of the current state of the output buffering, and<space>back
to give me a simplified backtrace. Why couldn't I just print outdebug_backtrace()
, I hear you ask? Because PHP usually dies when you do that, because recursive calls cause the process to run out of memory while trying to print your debugging message. Yes.When that wasn't enough, and I couldn't step through with a debugger (happens more than you'd expect) I wrote my own entire backtrace/debug module which shows you context, lets you click through to bitbucket or github or wherever the code is, lets you open each line in your local editor, gives info about VCS branches, PHP versions, that sort of thing. I had to use a lot of hacks to get it to work because PHP is so unfriendly towards debugging. But it does clever things like detecting if the exception was from PDO and printing the faulting SQL. I was quite pleased with that.