Skip to content

?->print() not working #2406

Open
Open
@jaulz

Description

@jaulz

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions