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

?->print() not working #2406

Open
jaulz opened this issue Oct 15, 2024 · 0 comments
Open

?->print() not working #2406

jaulz opened this issue Oct 15, 2024 · 0 comments

Comments

@jaulz
Copy link

jaulz commented Oct 15, 2024

Prettier 3.0.3

PHP Plugin 0.22.2

Input:

$unit = $unitNode?->print($context);

Output:

Error:  test.php: SyntaxError: Parse Error : syntax error, unexpected 'print' (T_PRINT) on line 549
Error:    549 |     $unit = $unitNode?->print($context);

Expected behavior:
It seems that print is the culprit. I would expect that I can call a print method the same way any other method with the conditional chaining before. This code seems to work in contrast:

$unit = $unitNode?->test($context);
@jaulz jaulz changed the title ?->print not working ?->print() not working Oct 15, 2024
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

No branches or pull requests

1 participant