Climbing the Abstract Syntax Tree

The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run. To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before. After seeing this talk, you'll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code. (*actual magic or time-warp not guaranteed)

Although I was a bit perplexed by all the heavy code on the screen, James did a good job in simplifying things and explaining just how AST contributes to the higher performance gains with PHP 7.

Not sure I will be coding my own compiler any time soon, but what I will take away from this talk is an appreciation to the advancements that have been made and spending time reading up on all the underlying technologies that a code-pleb like me is not generally aware of!

This talk was fascinating, although I will admit it did get quite complicated at some points. I probably wasn't the right target audience (since I am not interested into delving THAT deep into PHP's inner workings, and playing around with them) but it was still great to get insight into how PHP 7 has changed to an AST, what it is, how it works and what developers can do to leverage it.

It was also great to see the tools with some examples, and writing our own compiler through the slides was an interesting exercise to get an idea of the logic needed. Overall this is an great talk, and I'd recommend it for more senior developers and anyone interested in understanding PHP's inner workings (and the AST especially)