Skip to content
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

Fix false positives on assign-by-reference within function call in ForbiddenCallTimePassByReferenceSniff #302

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Dec 14, 2016

While assigning to a variable within a function call or conditional might not be good practice, the reality is that there is plenty of userland code out there using it.

This PR should fix false positives for variables being assigned by reference within function calls.

It also should fix false positives for variables being compared by reference within function calls.

Includes additional unit tests.

Refs:
http://php.net/manual/en/language.references.whatdo.php#language.references.whatdo.assign
http://php.net/manual/en/language.operators.assignment.php#40084

Fixes #68 (comment)
Fixes #68 (comment)

/cc @octalmage

…rbiddenCallTimePassByReferenceSniff

While assigning to a variable within a function call or conditional might not be good practice, the reality is that there is plenty of userland code out there using it.

This PR should fix false positives for variables being assigned by reference within function calls.

It also should fix false positives for variables being compared by reference within function calls.

Includes additional unit tests.
@wimg wimg merged commit 9d48ecc into PHPCompatibility:master Feb 6, 2017
@jrfnl jrfnl deleted the feature/fix-call-time-assign-by-reference branch February 9, 2017 07:32
@jrfnl jrfnl added this to the 7.1.2 milestone May 2, 2017
@jrfnl jrfnl added the bug label Mar 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assign-by-reference false positive for call-time pass-by-reference sniff
2 participants