A microbenchmark showing one implementation four times faster than another, where the difference was the loop.
// the wrong shape
$start = microtime(true);
for ($i = 0; $i < 1_000_000; $i++) {
$result = $impl->format($value);
}
$elapsed = microtime(true) - $start;
// the optimiser is free to hoist an invariant call, the
// result is never used, and the first implementation
// warms a cache the second one then benefits from.
Three separate errors in six lines: an unused result, a shared warm state, and no separation between the loop overhead and the work. Running each implementation in its own process, alternating the order, and using the result was enough to show the real difference was 8% rather than 300%. A benchmark that produces a surprising number is usually measuring itself.