by humanrebar · 13y ago · 0 comments
That is, one could argue that a good language is one that lets developers ignore trivial changes like this without hurting performance.
A function call in a loop condition might have side effects or do something very unorthodox.
Pulling redundant work out of loops is a category of optimization that is widely used. In many cases, the optimizer can detect a lack of side effects on $list inside the loop body and perform the above optimization.
The implementation by facebook (HipHop) might have such an optimization though.