Skip to content

invalid ast for silent #247

@alexander-akait

Description

@alexander-akait

Input:

$var = @foo() || @foo();

silent node should be before call, now it is before bin

Right output from php parser:

array(
    0: Stmt_Expression(
        expr: Expr_Assign(
            var: Expr_Variable(
                name: var
            )
            expr: Expr_BinaryOp_BooleanOr(
                left: Expr_ErrorSuppress(
                    expr: Expr_FuncCall(
                        name: Name(
                            parts: array(
                                0: foo
                            )
                        )
                        args: array(
                        )
                    )
                )
                right: Expr_ErrorSuppress(
                    expr: Expr_FuncCall(
                        name: Name(
                            parts: array(
                                0: foo
                            )
                        )
                        args: array(
                        )
                    )
                )
            )
        )
    )
)

But

$var = @(foo() || foo());

Output valid ast.

Very high priority.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions