Skip to content

Conversation

@sirbrillig
Copy link
Owner

@sirbrillig sirbrillig commented Dec 12, 2017

Fixes #13

When a variable is found, we use findWhereAssignExecuted() to consider where to mark that variable as "ready to be used" (eg: this is illegal if $foo is not defined: $foo = $foo + 1;). It checks for semicolons or closing parenthesis and returns whichever comes first.

In this case, the expression ($foo = 1, $foo) uses the variable before either a semicolon or a parenthesis; instead it uses a comma.

This PR adds T_COMMA as a possible ending token as well.

@sirbrillig sirbrillig force-pushed the fix/argument-assign-scope branch 3 times, most recently from d0360df to ea4581f Compare December 12, 2017 23:43
This is an example of the assignment scope bug mentioned in #13
@sirbrillig sirbrillig force-pushed the fix/argument-assign-scope branch from ea4581f to ee9d6e6 Compare December 12, 2017 23:54
@sirbrillig sirbrillig merged commit 43713f0 into master Dec 13, 2017
@sirbrillig sirbrillig deleted the fix/argument-assign-scope branch December 13, 2017 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants