Prepare the parser to PHP 8 :
Work In Progress as RFC are not yet closed
https://wiki.php.net/rfc/nullsafe_operator
What is the status about php 8 support?
What鈥檚 new in PHP8?
I鈥檇 suggest creating an separate issue for each if these features.
Compiled from https://www.php.net/releases/8.0/en.php
There are now patches available for:
so really the work just needs to focus on attributes, however I am not sure the right way to update the lexer to support Attributes.
Hi @cseufert
Awesome work! #662 has been merged in a temporary php8 branch because I don't know the codebase well enough to just merge stuff into master before @ichiriac took a look as well. If you like, you can point your PRs to the php8 branch as well, and I'll try to find some time for a first review :)
I have changed the following PR's to merge to the php8 branch:
I am going to have a go at getting this stuff working in prettier at some point, and am looking foward to having someone who know the codebase have a review of the code. I feel it could benefit a lot from being ported to typescript, but I guess thats a totally different problem.
Awesome! As I said before, reviews in the parser are also quite difficult for me - I'm more comfortable on the prettier side. Either way I'll try to do my best to help, it would be awesome to have full php8 support in the prettier plugin :-)
Hello,
There is no tracking for non-capturing catches - } catch (Exception) { Parse Error : syntax error, unexpected ')'
I created a pull request https://github.com/glayzzle/php-parser/pull/755
Is this the correct place to remark on an error I noticed with parsing of promoted constructor params? php-parser complains about a syntax error when a promoted constructor param is marked as nullable with a question mark
public function __construct(public ?string $nullable) { }
Is this the correct place to remark on an error I noticed with parsing of promoted constructor params? php-parser complains about a syntax error when a promoted constructor param is marked as nullable with a question mark
public function __construct(public ?string $nullable) { }
I have submitted a PR to fix this in the parser:
https://github.com/glayzzle/php-parser/pull/785