Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP8: Nullsafe operator support #658

Closed
Wulfheart opened this issue Feb 5, 2021 · 3 comments
Closed

PHP8: Nullsafe operator support #658

Wulfheart opened this issue Feb 5, 2021 · 3 comments

Comments

@Wulfheart
Copy link

#486

@czosel
Copy link
Collaborator

czosel commented Feb 7, 2021

Currently, we're parsing $foo->bar as

      {
        "kind": "propertylookup",
        "loc": { ... },
        "what": {
          "kind": "variable",
          "loc": {...},
          "name": "foo",
          "curly": false
        },
        "offset": {
          "kind": "identifier",
          "loc": { ... },
          "name": "bar"
        }
      }

PHP-Parser is parsing $foo?->bar as

0: Stmt_Expression(
       expr: Expr_NullsafePropertyFetch(
           var: Expr_Variable(
               name: foo
           )
           name: Identifier(
               name: bar
           )
       )
   )

I'd say we can implement this here using kind: "nullsafepropertylookup".
cc @ichiriac

@ichiriac
Copy link
Member

ichiriac commented Apr 4, 2021

@alexander-akait
Copy link
Collaborator

Fixed in php8 branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants