Skip to content

"arrowfunc" puts body into a block #1007

@deakjahn

Description

@deakjahn

When an arrow function is parsed, the body part is placed into a block instead of an expression. This might be not very important when analyzing PHP code but when it comes to recreating the PHP from the AST, it actually is a problem because a block would be enclosed in braces, while the expression in the arrow function is not. So, it has to be worked around with a hack.

The function body should be an expression rather than a block, as described in the documentation: https://www.php.net/manual/en/functions.arrow.php

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