-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[PHP 7.4] Add coalesce equal ??=
#575
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
Conversation
??=
Yes, it should use |
Thanks for navigation. I dig through history and blame and tried to inspire at: 251e689 Emulative parsers seems to work, but grammer still looks broken. Any clue? |
Not sure what's up with the test failure. Token 392 on PHP 7.1 is E_ERROR, but I don't really see why it would occur in this situation. |
Thanks for review, I'll integrate it and see it helped with the error. |
Now the parser is rebuild without error 👍 Yet the error still remains: 1) PhpParser\PrettyPrinterTest::testPrettyPrint with data set "var/www/PHP-Parser/test/code/prettyPrinter/expr/operators_php7.test#0" ('Basic operators (/var/www/PHP....test)', '<?php\n\n$a ??= $c;', '$a ??= $c;', 'php7')
RangeException: The lexer returned an invalid token (id=281, value=??=) Test fixture -
|
Any tips what tests should I add? |
Okay, I believe this issue here is that the token is not used in the PHP 5 parser and thus gets dropped from the translation table. It would be fine if you just add support for One thing that's missing here is a parser test for |
Works like a charm!
👍 I'm on it |
Merged as 9de9682. Thanks :) |
👍 Thank you |
Any ETA for release of this? I'd love to test in Rector and real code to demonstrace PHP 5.3 → 7.4 upgrade |
Wow! Thank you ❤️ |
Adds
??=
support php/php-src#3747Tests are failing.
It looks like it's not possible to add it. Probably needs to wait for
T_COALESCE_EQUAL
token, or not?