O'Reilly logo

Programming PHP, 3rd Edition by Peter MacIntyre, Kevin Tatroe, Rasmus Lerdorf

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

IDE Debugging

For more complex debugging issues, you would be best served to use a debugger that can be found in a good IDE (Integrated Development Environment). We will be showing you a debug session example with Zend Studio for Eclipse. Other IDEs, like Komodo and PhpED, have built-in debuggers, so they can also be used for this purpose.

In Zend Studio, there is an entire Debug Perspective set up for debugging purposes. Figure 16-1 shows the default look of this perspective.

The default Debug Perspective in Zend Studio

Figure 16-1. The default Debug Perspective in Zend Studio

The menu is the place to start with this debugger to get your bearings. Pull down the Run menu and you will see all the options that you can try when in the debug process. Stepping into and over code segments, running to a cursor location, restarting the session from the beginning, and just simply letting your code run until it fails or ends are just some of the options available.

Note

In Zend Studio for Eclipse you can even debug JavaScript code with the right setup!

Check the many debug views in this product as well; you can see and watch the variables (both superglobals and user-defined) as they change over the course of executing code.

Breakpoints can also be set (and suspended) anywhere in the PHP code, so that you can run to a certain location in your code and see what the overall situation is at that particular moment. Two other very handy views that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required