Skip to content

Define statements that are expressions fail to parse #182

Closed
@mvriel

Description

@mvriel

When you define a global constant as a define with the NAMESPACE magic constant (for example); this library will throw an error:

Notice: Undefined property: PhpParser\Node\Expr\BinaryOp\Concat::$value
strpos() expects parameter 1 to be string, null given

This is because this library assumes that the value of the Define node is always a string; while this is not necessarily true

Example case:

define(__NAMESPACE__ . '\\MY_CONSTANT', 123);

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