Skip to content
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.2 Support: Fetch properties of enums in const expressions #4966

Conversation

junichi11
Copy link
Member

PHP 8.1 Support: New in initializers (Part 5)

nb-php81-new-in-initializers-const-access

PHP 8.2 Support: Fetch properties of enums in const expressions (Part 1)

nb-php82-fetch-properties-of-enum-in-const-expressions1
nb-php82-fetch-properties-of-enum-in-const-expressions2

Note

The following code is valid but I don't think these are meaningful. So, I don't support these cases at the moment.

const A = (null)?->test;

const B = (null)?->test->test;

const C = (null)->test?->test;

const D = (null)?->test['test'];

const E = (null)['test']?->test;

const F = (null)?->{new Printer};

const G = (null)?->test + (new Printer ? 1 : 0);

const H = (1)->prop;

const I = (1)?->prop;

- https://issues.apache.org/jira/browse/NETBEANS-5599
- RFC:https://wiki.php.net/rfc/new_in_initializers
- Support for field and method access for constant (e.g. `const C = new A(); C->field; C->method();`)
- Fix the parser
- Fix PHP81UnhandledError
- apache#4725
- https://wiki.php.net/rfc/fetch_property_in_const_expressions
- Fix the grammar file
- Fix CC: add the readonly name property to enums
- Add/Fix unit tests for the parser and CC
@junichi11 junichi11 added the PHP [ci] enable extra PHP tests (php/php.editor) label Nov 15, 2022
@junichi11 junichi11 added this to the NB17 milestone Nov 15, 2022
@junichi11 junichi11 mentioned this pull request Nov 15, 2022
6 tasks
@junichi11
Copy link
Member Author

@tmysik Could you please have a look at this when you have time? If there is no problem, let's merge it. Thanks!

Copy link
Member

@tmysik tmysik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, great job! And thanks for all the unit tests.

@tmysik tmysik merged commit 3be3304 into apache:php82-support Nov 15, 2022
@junichi11
Copy link
Member Author

@tmysik Thank you for your review and your time :)

@junichi11 junichi11 deleted the php82-fetch-properties-of-enums-in-const-expressions branch November 15, 2022 23:05
@tmysik
Copy link
Member

tmysik commented Nov 16, 2022

@junichi11 Nothing to thank for, really.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PHP [ci] enable extra PHP tests (php/php.editor)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants