Summary of my work on LLVM in 2022.
An introduction to the inner workings of the opcache optimizer, or at least some parts of it.
Type variance allows types to change during inheritance in a way that is compatible with the Liskov substitution principle. This article describes how this works on a technical level.
Early binding allows using a class before its declaration in the same file. However, the precise behavior is rather arcane.
A brief overview of how the PHP opcache extension works, covering the caching-related aspects only.
Discusses a number of design issues related to IR canonicality: Pointer element types, type-based GEP, and constant expressions.
Introduces a compile-time tracking service for LLVM, and some specific compile-time improvements I have implemented.
An overview of the PHP virtual machine.
Covers the implementation of complex types like strings and objects in PHP 7, as well as a number of special types like indirect zvals.
Describes and compares the zval implementations used by PHP 5 and PHP 7, including a discussion of references. Other types are covered in the next part.
In this article we'll explore how the new hashtable implementation used by PHP 7 improved memory usage and performance.
This article discusses the merits of allowing method calls on primitive PHP types, like strings and arrays.
This article describes a number of techniques to improve performance of regular expression based dispatch processes, as used in request routing or lexing.
The ifsetor function can be used to suppress notices when accessing array indices. This post discusses some of the issues this function has and how to resolve them.
This post explains how coroutines can be used for task scheduling and handling asynchronous operations in a synchronous-seeming way.
PHP developers don't seem to like normal functions much. I think that this is related to the one-to-one class to file mapping that PHP has inherited from Java.
In this post I'm describing how one can add new syntax to PHP. At the same time, this post can be seen as a general introduction to the workings of the Zend Engine.
PHP 5.5 is still in an early development stage, but there are already many proposals that are being worked on. This post gives some insights into the recent developments.
Configuration files typically use XML or some other domain specific language. But why? Why not just use the usual programming language instead?
PHP is a great language to start programming. And once you started, PHP is also good for "real" programming. So what's the problem?
There is a major misunderstanding about what modern regular expression implementation can or cannot do. This article analyses the situation by walking through the different grammar classes.
The fourth part of the "PHP's Source Code for PHP Developers" series, covering how arrays are internally implemented in PHP and how they are used in the source code.
Cross-link to the third part of the "PHP's Source Code for PHP Developers" series, covering how PHP values are represented internally and used throughout the source code.
The second part of the "PHP's Source Code for PHP Developers" series, covering how to find functions in the PHP source code and how they are structured.
A quick overview of the different scalar type hinting proposals and why PHP is having such a hard time deciding.
JS implementations use some neat tricks to achieve good performance. One of those tricks is a good bit of pointer magic to make dynamically typed values more efficient.
There is some nice new stuff for htmlspecialchars() in PHP 5.4, which hasn't yet got the attention it deserves.
In some cases XDebug can significantly skew your benchmarking and profiling numbers. So make sure that you do measurements without it.
One of the oldest myths around PHP is that single quotes are faster than double quotes. And. It. Is. Not. True.
Inserting 65536 specially crafted values into a PHP array can take 30 seconds, whereas normally it would only take 0.01 seconds.
Introducing STUPID: Singleton, Tight Coupling, Untestability, Premature Optimization, Indescriptive Naming, Duplication.
PHP's memory usage might seem atrocious to some - twenty times more than the optimum you would have in C. This post tries to explain those numbers and why they are necessary.
There is a huge number of newline related features in PCRE (regular expressions) that nearly nobody knows about. I want to shed light on some of those.
If you ever tried to install PEAR on Windows you probably know what a woeful task it is. This is a short instruction on how to manually install PEAR (without using go-pear.phar).
PHP's foreach language construct sometimes copies the array it iterates and sometimes does not. This post analyzes when and why this happens.
Some thoughts on improving lexing performance in PHP by compiling the individual token regexes into one big super-regex.