This benchmarks transformation of a large array (many members):
- Use foreach to construct a static transformed array
- Use an Iterator to transform dynamically on-the-fly
- Use array_walk to construct a static transformed array
Results:
The naive "foreach" loop is fastest.