1. 6
  1.  

  2. 3

    The largest (and most invisible) is the addition of an Abstract Syntax Tree (AST) — an intermediate representation of the code during compilation. With this in place, we are able to clean up some edge case inconsistencies, as well as pave the way for some amazing tooling in the future, such as using the AST to produce more performant opcodes.

    How was PHP interpreted prior to this?

    1. 2

      The parser would call directly into the interpreter. Compare this (5.6 ish) with this (6 ish).

      1. 6

        Admittedly tangential comment: This used to be a common way of structuring compilers as well, though quite a long time ago. In the ‘60s there was an active debate between one-pass and multi-pass compilers, with the former translating parsed bits directly to machine code as soon as possible, and the latter constructing complete parse trees and then reducing those through one or more further passes to machine code. The one-pass compilers used less memory, and some researchers furthermore perceived them as an interesting challenge: it seemed like it should be possible to flatten multiple conceptual passes into one efficient physical pass over the input stream. Probably the most lasting legacy of this challenge was the invention of coroutines, which were first conceived of as a way to handle interleaved input contexts in a one-pass compiler.

        1. 2

          Actually, for me it looks like both are the same code, down to a comma.