Web design portfolio - 595Chapter 32DebuggingThen, once you have chosen the function

595Chapter 32DebuggingThen, once you have chosen the function you want, you might go into the parentheses to theright of the function name and start to insert the name of a variable by typing $. Again, ZendDevelopment Environment presents you with a list of available variables (it s very clever andtakes scope into account) and allows you to choose from the list with your mouse. Again, anopportunity for a silly typing error to cause a bug is eliminated. Finding errors when they occurThe value of a visual debugger can really become obvious when it s time to work through aprogram line-by-line to see where problems are appearing and what can be done about them. While, as discussed earlier in this chapter, it s possible to monitor programs to a certainextent by outfitting them with extra echoand print_r()statements that help you tracewhat s happening, that can be a laborious process and is suitable only for quick diagnoses oroccasional troubleshooting work. The tools in Zend Studio are vastly more useful and will payfor themselves quickly if you do a lot of debugging work. Stepping through programsZend comprises a client element and a server element. When installed together in a develop- ment environment, they can share information back and forth. One key advantage of this: The client (under the control of the programmer) can halt execution, or see the progress ofexecution line by line. Moving at such a deliberate pace, you can get a better idea of what s going on, particularlywhen you can monitor variable values at the same time. Monitoring variable valuesZend Studio provides programmers with a window into all their programs variables thosedeclared internally, by the program itself, and those available from outside (the $_POSTarray, for example). Figure 32-4 shows the Variables pane (in the lower-right corner of the application) displayingsome environment variables contained in the superglobal $_ENVarray. Using breakpointsWhen you re working with a long program, you don t always want to step through the wholething one line at a time. Instead, you might choose to establish a breakpoint. The debuggerwill execute normally up to the breakpoint; then it will pause. While execution is paused at the breakpoint, you can examine variable values, or begin tostep through a critical portion of your program slowly. It s one more tool to make your debug- ging more efficient.
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.

Leave a Reply