z7zmey / php-parser

PHP parser written in Go

Home Page:https://php-parser.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHP 7.4

z7zmey opened this issue · comments

Any news on this? 🙏

I worked on #81, but admit defeat.
I have not dealt with this task yet, but this task is the main priority.

$str = <<<FOO
abcdefg
    FOO
FOO;

There is a backward incompatibility in the scanner. The example above invalid since PHP 7.3. So parser will have to know the minor version to parse a code correctly.

Maybe by default it could use the new syntax and option to specify the old one?

Agree, by default it would be the latest version.

Also, I plan not to handle heredoc indentation. Only allow whitespace before the end label and other tokens before the new line.

If somebody wants to strip indentations, it will be able to check and handle the string manually in the client code.