glayzzle / php-parser

:herb: NodeJS PHP Parser - extract AST or tokens
https://php-parser.glayzzle.com/
BSD 3-Clause "New" or "Revised" License
537 stars 71 forks source link

Runtime ::class const doesn't work properly #1135

Open jorgsowa opened 4 months ago

jorgsowa commented 4 months ago
<?php

$class[0]::class;

Result:

Parse Error : syntax error, unexpected 'class' (T_CLASS) on line 3

  1 | <?php
  2 |
> 3 | $class[0]::class;
    |           ^

Sandbox: https://loilo.github.io/prettier-php-playground/#N4IgDgTgpgLjCWUIHkwIPYDsDOIBcok8mMA6vACYwAW+AHAAwA0IMAhgEblW14AsLAK7YoAFU648AMzYAbES2zEA5rKgBFQehhR8M+VBZhqYAGpIlWfCACsAOj4gWMCG3iyVAYXQBbH2wAFAAkA-BdBQxAOVwBjKABlGABPNWswJABaGNwWaABHQXhoANdlfz05BRBiEQgYErYytgqDAF8WKAp4GHQUNHgsSVA2bBgWkXbqzDBBMbwQAB4AfmMwAB1MDYASGNkR7ABtBgBdPDxd-YBuEFagA