3 ms·
I get what you mean, but it might be helpful to translate it for everybody else: Foreach is doing an assignment in each iteration, robryan is right. But PHP v
by encoderer 14y ago
I get what you mean, but it might be helpful to translate it for everybody else:
Foreach is doing an assignment in each iteration, robryan is right. But PHP variables are copy-on-write so $user is, until modified, just an entry in the symbol table which is very fast.
And that for() loop also has an assignment -- the incrementer.