spacer
Web Development Tutorials PHP Tutorials
 Developer Newsletter

Tutorials
AJAX
ASP
CGI & Perl
CSS
Flash
HTML
Illustrator
Java
JavaScript
Linux
MySQL
PHP
Photoshop
Python
Wireless
XML
Miscellaneous


Scripts Directory
AJAX Scripts
ASP Scripts
ASP.NET Scripts
CGI & Perl Scripts
Flash Scripts
Java Scripts
JavaScript Scripts
PHP Scripts
Python Scripts
Remotely Hosted Scripts
Tools & Utilities Scripts
XML Scripts

Web Hosting Directory
ASP.NET
Budget
Dedicated Servers
Ecommerce
Linux
Resellers
Shared
Small Business
Windows

Developer Manuals
Learn HTML
Learn PHP
Learn CSS
Learn JavaScript
Learn Pear
Free White Papers

Developer Resources
Developer Tools
Developer Content
Survey Software
Dedicated Servers




PHP Debugging with Zend Studio

By Michael J. Ross
2008-02-03


Breakpoints and Conditions

Stepping through each individual line of code is fine if there are few of them, as in our example, or you want to see the effects of most if not all the lines of code. But what if you are only interested in a bit of code in a huge program? That's where breakpoints become indispensable. Imagine that the very first line of display_workers() — where the database handle $db is made global — is where you first want to begin debugging. Click on the line number (in this case, 43) and the entire line is colored pink, indicating that a breakpoint has been set on that line. Then when you run the Go command, the debugger executes all the way up to that line, and stops, regardless of how deep in the code the line is located.

Perhaps you would like the debugger to execute the "for" loop until the loop counter, $i, is equal to 3. In that case, you would first set a breakpoint on that line. Then, set a condition for that breakpoint: In the Debug window's Breakpoints tab, right-click on the breakpoint, select "Edit Condition", and enter "$i = 3" as the watch expression. Then use the Go command to execute up to that point where $i is equal to 3, which is confirmed in the Variables tab in the Debug window.



Tutorial Pages:
» Introduction
» Overview and Product Editions
» System Requirements
» Installation and Start Up
» User Interface and Preferences
» Debugging Basics
» Stepping Through the Code
» Breakpoints and Conditions
» Conclusion


Related Tutorials:
» Web Database Access from Desktop Applications
» CubeCart 3.0 Installation and Configuration
» PHP Site Search Made Easy
» Installing and Configuring Drupal 6.1
» Desktop Application Development with PHP-GTK
» Installing PHP on Windows



About the NetVisits, Inc Network | Write For Us | Advertise
Copyright ©2007 NetVisits, Inc Network. All Rights Reserved. Privacy Policy.
Visit other NetVisits, Inc. sites: