PHP Architect · Vol 18, Issue 7 · July 2019
Internal Apparatus: A Walk Through the Generated Code
by Edward Barnard
The PHP compiler/interpreter reads through our PHP code and produces an intermediate form. PHP’s virtual machine then interprets this intermediate form. PHP’s “generated code” feature allows us to walk through this intermediate form, better understanding exactly what PHP does with the software we write. We’ll begin with a three line example, observing the generated-code changes as we transform our example into a function call and then a static method call. We’ll implement a recursive algorithm to see how the code generator handles the situation.
The full article is in PHP Architect Vol 18, Issue 7. Subscribe to read it and every new issue.