15 posts

Blog

Posts and notes.

Internals8 min read

The opcode is not the handler

The same loop ran 23% faster with int parameters, and only with OPcache on. Operand classes pick a handler when the file compiles; proven types pick a different one.

Internals9 min read

A declared property is cheaper than an array key

One hundred thousand four-field records cost 143.54 bytes each as objects and 397.14 as associative arrays. Where the crossover is, and what one undeclared property costs.

Internals11 min read

What a PHP variable actually is

A zval is sixteen bytes, a value union and a type tag. What that tag says decides whether an assignment copies anything, what a reference costs, and which variable pays.

Runtime14 min read

PHP-FPM process management in production

pm static, dynamic and ondemand, the memory ceiling nothing enforces, and how to size a pool from measurements rather than guesses.

Arrow keys to move, Enter to open.