Hi,
Can anyone tell me if there is a way to output var_dump() or print to a console like a gdbp client? It just seems wrong to mix in debug info with the web app on screen.
Trying to understand the app I'm working with. Just want to be able to drop in dumps throughout the app and see what's going on through a separate console.
Any guidelines on the best practices for debugging. I have been trying to setup xdebug with eclipse, and I have to say the process for a noob sucks! Why does it have to be so freakin complex?!?
Also, any recommendations on the best ide? Is Zend studio better then PDT? Is Zend Debugger better then XDebug?
Thanks for any help!
Debugging - Best tools and practices
Moderator: General Moderators
-
lockerrushing
- Forum Newbie
- Posts: 4
- Joined: Thu Nov 20, 2008 3:24 pm
Re: Debugging - Best tools and practices
Create yourself a print_debug() function and use that instead of var_dump() that way you've got a central location to change where it's output goes etc.
I must ask, however, just for clarity - is this regarding Legacy code (Legacy code is code that does not have accompanying Tests/Specs) or are we talking about 'debugging' tested code?

As for IDE's, I've not used Zend, but I liked PDT (and Eclipse with SVN/FTP/etc plugins) a lot.
I must ask, however, just for clarity - is this regarding Legacy code (Legacy code is code that does not have accompanying Tests/Specs) or are we talking about 'debugging' tested code?
As for IDE's, I've not used Zend, but I liked PDT (and Eclipse with SVN/FTP/etc plugins) a lot.
Re: Debugging - Best tools and practices
Eclipse has GUI debugging? I'd have to give it a whirl if it did. Heard good things about it
-
lockerrushing
- Forum Newbie
- Posts: 4
- Joined: Thu Nov 20, 2008 3:24 pm
Re: Debugging - Best tools and practices
Hey Jenk, thanks for the reply. I'm working with an open source shopping cart. Just trying to get a feeling for the inner workings. So if I understood correctly, I should make a custom dump function and redirect the dump to an external console? How exactly do I do that part of it?
Thanks
Thanks
Re: Debugging - Best tools and practices
Dumping to the console won't be easy, dumping to a file would be much easier. If you're on *nix, you could `tail -f` the file in a terminal if you want a 'live feed' as it were.