Output

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.

 

Want to learn PHP 7?

Hacking with PHP has been fully updated for PHP 7, and is now available as a downloadable PDF. Get over 1200 pages of hands-on PHP learning today!

If this was helpful, please take a moment to tell others about Hacking with PHP by tweeting about it!

Next chapter: Planning it out >>

Previous chapter: Analysis

Jump to:

 

Home: Table of Contents

Copyright ©2015 Paul Hudson. Follow me: @twostraws.