Skip to content

Parser does not detect invalid cast expressions #33

Open
@mattacosta

Description

@mattacosta

Cast expressions may not contain anything except spaces and tabs between the parentheses.

In the following example, the parser generates a CastExpression while PHP sees it as a constant named 'int' followed by a variable.

Example:
<?php (/* hello */int)$a;

Actual result:
No error.

Expected result:
syntax error, unexpected $a (T_VARIABLE)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable buggrammarup-for-grabs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions