Tags

zend-vm

7 posts

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.

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.

Internals9 min read

PHP arrays are not arrays

One structure serves as list, dictionary and set. Packed and hashed layouts, what each costs in memory, and when a conversion happens.

Internals8 min read

What happens when PHP runs your code

A request walks from the SAPI to the Zend VM — lexing, compilation to opcodes, the OPcache lookup that skips both, and execution.

Arrow keys to move, Enter to open.