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

During all "unwrap" functions, return the real values instead of values wrapped with Node\Arg() class #1853

Merged
merged 2 commits into from
May 12, 2023

Conversation

maks-rafalko
Copy link
Member

@maks-rafalko maks-rafalko commented May 11, 2023

During all "unwrap" functions, return the real values instead of values wrapped with Node\Arg() class

Fixes #1799

Failing (before) code:

$array->{substr($key, 0, -2)}()

Explanation: before this update, we incorrectly return all the values, wrapped with Node\Arg() class, since before mutating they were arguments of unwrapped function.

For example:

- $a = substr('test', 0, -2);
+ $a = 'test';

here, in pseudo-AST, we did the following:

$a = Node\Arg('test');

which is not correct

@maks-rafalko maks-rafalko enabled auto-merge (squash) May 11, 2023 21:05
@maks-rafalko maks-rafalko merged commit f669c4e into master May 12, 2023
40 checks passed
@maks-rafalko maks-rafalko deleted the bugfix/1799-pretty-printer branch May 12, 2023 20:45
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.

Fatal error on code $array->{substr($key, 0, -2)}()
1 participant