Skip to content

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

New issue

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

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

Already on GitHub? Sign in to your account

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

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

Successfully merging this pull request may close these issues.

1 participant