Creating a Simple Script
Prev | Debugging a Project Locally Using PHPEclipse and XDebug | Next

## Creating a Simple Script

To begin, open up an existing PHP file in an existing project. For this tutorial, we will be using the project created in the tutorial 'Creating a Project Using PHPEclipse' but you can use any PHP project you like.

To start, we will create a simple script that has some variables and a control structure. This will give us something interesting to view with the debugger. We'll start with the code below:

    $output = '';

    for ($i=0;$i<10;$i++) {
        $output .= 'Loop'.$i.' ';
        echo $output;
    }

This program is very simple, but it will allow us to watch variables and step through a program.

Prev | Up | Next
Debugging a Project Locally Using PHPEclipse and XDebug | Home | Setting up the Debugger