
internals
A by-reference foreach leaves a reference in every element
Walking an array with foreach ($rows as &$row) wraps every element in a zend_reference. On a million integers that is 32 MB the loop never gives back.
3 posts

Walking an array with foreach ($rows as &$row) wraps every element in a zend_reference. On a million integers that is 32 MB the loop never gives back.

OPcache removes compilation, not execution. The JIT reaches arithmetic-heavy code and little else. Where the remaining time lives.

Microbenchmarks measure exactly what you tell them to, which is rarely what you meant. Method, noise, and the numbers worth reporting.