Tags

hashtable

4 posts

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.

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.

Arrow keys to move, Enter to open.