foreach: clone array before iteration for copy-on-iterate semantics #3
Loading…
Reference in a new issue
No description provided.
Delete branch "jnana/foreach-copy-on-iterate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This change ensures that modifications to the array inside a foreach loop
don't affect the iteration, matching PHP's behavior where foreach works
on a copy of the array.
Fixes: foreach copy-on-iterate (Roadmap Maybe later item)