-
-
Notifications
You must be signed in to change notification settings - Fork 124
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix dynamic propertylookup #183
Conversation
45510de
to
2ee0626
Compare
is it worth considering doing this from the parent level instead of the child? ie when we print the property lookup, and |
@mgrip Of course, i can't believe i didn't notice that 馃槄 |
@@ -23,6 +23,6 @@ $encapsHereDoc2 = <<<STR | |||
Hello foo $a bar | |||
new line | |||
STR; | |||
$encapsedOffset = $a->bar$b; | |||
$encapsedOffset = $a->{bar$b}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is $a->bar$b
valid PHP?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, it seems to be a parse error in PHP7
php > $a = new stdClass;
php > $a->foobar = 1;
php > $b = 'bar';
php > echo $a->{"foo$b"};
1
php > echo $a->foo$b;
Parse error: syntax error, unexpected '$b' (T_VARIABLE), expecting ',' or ';' in php shell code on line 1
php > echo $a->{foo$b};
Parse error: syntax error, unexpected '$b' (T_VARIABLE) in php shell code on line 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
馃憤 i'll remove it from the tests ... done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good solution 馃憤
There are probably many cases where this still breaks, but it might be an improvement anyway 馃槃
#112