In PHP 3, each line of code was read and executed as it was encountered, which meant that it really didn't have an output phase as such - the "output" was the code being executed. This was redone in PHP so that opcodes were generated as each line was read in, and iterated through as part of the execution. The second option is a great deal faster for execution, as you don't need to continually reparse, and recheck each line of code as it is encountered. However, it is a great deal harder to do, so we'll be looking to emulate the PHP 3 execution style: read a line in, and execute it immediately.
So, the output of our compiler will be an executed script. After every line has been read in, it will be executed immediately.