-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
PHP 8 support? #1599
Comments
No it is not supported, we need improve parser |
Upstream issue: glayzzle/php-parser#486 |
Sorry, is php 8 support ready? |
No, we need update our parser, you can help |
@alexander-akait This repo https://github.com/glayzzle/php-parser ? |
Yes |
@eldair would you like to collaborate? |
@Wulfheart it will take me some time to see how it all works, but I would like to help. |
I opened a PR (wip) for php-parser, but it seems not actively maintained anymore. |
@Selion05 I also have merge permissions at the parser, but I don't know the codebase too well. Let's try to collect PHP8 related changes in a separate branch for now. |
ok nice! Yeah I don't know it either. We will figure it out :D I Will work on it tomorrow |
Awesome! I'll do my best to help. I'm a little short on time so it might be just reviews, we'll see 🙂 |
Does this PR support https://www.php.net/manual/en/control-structures.match.php Here's the output I get when I try formatting the following snippet: <?php
// /tmp/test.php
// here's some trivial code:
$x = 2;
echo match ($x ) {
1, 2 => 'Same for 1 and 2',
3, 4 => 'Same for 3 and 4' ,
} . PHP_EOL; $ npx prettier --php-version 8.0 /tmp/test.php
[error] test.php: SyntaxError: Parse Error : syntax error, unexpected ',', expecting '}' on line 6
[error] 4 |
[error] 5 | echo match ($x ) {
[error] > 6 | 1, 2 => 'Same for 1 and 2',
[error] | ^
[error] 7 | 3, 4 => 'Same for 3 and 4' ,
[error] 8 | } . PHP_EOL;
[error] 9 | Environment
* installed with |
@mklein994 no, only named arguments and nullsafe property lookup are supported at this point (see PR description). |
I have been working on php-parser, and have added PR's for match, promoted properties, and union types, however no one seems to be reviewing any code in the last week or two. I am totally stuck how to parse PHP Attributes, I havent had time to figure out how to improve the lexer to parse attributes, rather than being seen as comments. |
I'll go ahead and close this issue in favor of the tracking issue for PHP 8 support: #1691 |
Does it support PHP 8?
thanks
The text was updated successfully, but these errors were encountered: