plugin-php icon indicating copy to clipboard operation
plugin-php copied to clipboard

`?->print()` not working

Open jaulz opened this issue 1 year ago • 0 comments

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 avatar Oct 15 '24 08:10 jaulz