Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Treat writing to a by-reference foreach loop variable as a read #221

Merged
merged 5 commits into from
Dec 30, 2020

Conversation

sirbrillig
Copy link
Owner

When a foreach loop variable (eg: $foo in foreach($data as $foo)) is a reference (eg: foreach($data as &$foo)), then any write to that variable should also count as a read, since it has the side-effect of modifying the original data (eg: $data in foreach($data as &$foo)).

Fixes part of #219

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant