Jump to content

what are you guys using for debugging php ?


pwired
 Share

Recommended Posts

I use NetBeans in combination with xdebug.

Works like a charm!

You can dive into object variables and see their internal status or just step through your code just like with any other real world debugger (as I'm used to have in java and/or .net).

It's funny: A couple of years ago I asked the same question in the official joomla forum and no one answered for a long time (and after some months there were like 2 replies) and here there are 4 replies in less than 2 hours...

  • Like 2
Link to comment
Share on other sites

I use NetBeans in combination with xdebug.

Works like a charm!

You can dive into object variables and see their internal status or just step through your code just like with any other real world debugger (as I'm used to have in java and/or .net).

It's funny: A couple of years ago I asked the same question in the official joomla forum and no one answered for a long time (and after some months there were like 2 replies) and here there are 4 replies in less than 2 hours...

Wait until Soma reads this and you'll have one more  :)

  • Like 1
Link to comment
Share on other sites

I think having a step debugger is incredibly valuable, especially when trying to understand a system you didn't create yourself (e.g. ProcessWire, or any CMS or framework you're building on top of). I develop on a mac, and my preferred solution is xdebug (which comes preinstalled on MAMP these days) with the very light-weight and simple "MacGDBp" app (which is like the GUI front-end for xdebug): https://www.bluestatic.org/blog/category/macgdbp/

  • Like 1
Link to comment
Share on other sites

If you want to move beyond just scattering echo or print_r through your code then the first step is getting xdebug installed in your PHP layer. After that you can use any debugger that supports it - several have already been mentioned. Personally, I like to use the vdebug extension inside vim. Single steps very well, you can set breakpoints on lines or conditions and inspect local and global variables as needed.

Link to comment
Share on other sites

I use Xdebug and PHP storm. Debugging is very easy using these tools and of course, you still have the regular PHP output capabilities as well.

Despite what has been said in this thread, I find being able to step through code incredibly useful so I would always use a real debugger over and above temporary logging. Using var_dump and so on means adding code and then having to remove it when you're done. Just adding a breakpoint is an easy way to work and nothing to change later, unless of course, you find your bug! :)

Hope this helps.

  • Like 1
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...