Skip to content

Remove depreacted curly brace offset syntax #5221

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

Closed

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Feb 28, 2020

No description provided.

@cmb69
Copy link
Member

cmb69 commented Feb 28, 2020

I'm afraid this requires discussion on internals@, since the respective RFC was not about the removal.

@Girgias
Copy link
Member Author

Girgias commented Feb 28, 2020

I'm afraid this requires discussion on internals@, since the respective RFC was not about the removal.

Isn't the usual process to remove everything deprecated in the previous release cycle?

@cmb69
Copy link
Member

cmb69 commented Feb 29, 2020

Isn't the usual process to remove everything deprecated in the previous release cycle?

Most RFCs dealing with deprecations also set a timeline for the removal. This RFC, however, put the removal in the "future scope" section, and did not specify the version ("in PHP 8 or another future release"). So I think the intent to remove the feature should be at least announced on internals@.

@Girgias Girgias force-pushed the remove-deprecated-alternative-syntax branch from 4ab82a8 to 8f5ecf6 Compare April 25, 2020 22:45
@Girgias Girgias force-pushed the remove-deprecated-alternative-syntax branch from 8f5ecf6 to b0327b9 Compare May 10, 2020 10:04
if (ast->attr & ZEND_DIM_ALTERNATIVE_SYNTAX) {
ast->attr &= ~ZEND_DIM_ALTERNATIVE_SYNTAX; /* remove flag to avoid duplicate warning */
zend_error(E_DEPRECATED, "Array and string offset access syntax with curly braces is deprecated");
}
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer to retain this code and generate an E_COMPILE_ERROR here, so we can provide a better error message. We can drop the actual grammar if/when we run into conflicts.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

Choose a reason for hiding this comment

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

Can you please add tests for the two errors (one in constexpr context, one outside)?

Copy link
Member Author

Choose a reason for hiding this comment

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

ACK.

@Girgias Girgias force-pushed the remove-deprecated-alternative-syntax branch 4 times, most recently from 7ad85b2 to 37a5ca6 Compare May 12, 2020 15:26
@Girgias Girgias force-pushed the remove-deprecated-alternative-syntax branch from 37a5ca6 to fe76690 Compare May 17, 2020 20:08
@Girgias
Copy link
Member Author

Girgias commented May 22, 2020

If there are no objections I'll merge this in a week

@@ -2614,9 +2614,8 @@ static inline void zend_emit_assign_znode(zend_ast *var_ast, znode *value_node)
static zend_op *zend_delayed_compile_dim(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
if (ast->attr == ZEND_DIM_ALTERNATIVE_SYNTAX) {
zend_error(E_DEPRECATED, "Array and string offset access syntax with curly braces is deprecated");
zend_error(E_COMPILE_ERROR, "Array and string offset access syntax with curly braces is not supported");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
zend_error(E_COMPILE_ERROR, "Array and string offset access syntax with curly braces is not supported");
zend_error(E_COMPILE_ERROR, "Array and string offset access syntax with curly braces is no longer supported");

Maybe?

Copy link
Member Author

Choose a reason for hiding this comment

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

Made the change just checking via CI I didn't forget any other place before merging

@Girgias Girgias force-pushed the remove-deprecated-alternative-syntax branch from fe76690 to 53af2b8 Compare May 22, 2020 12:27
@Girgias Girgias force-pushed the remove-deprecated-alternative-syntax branch from 53af2b8 to 23302c0 Compare May 22, 2020 12:30
@php-pulls php-pulls closed this in c803499 May 22, 2020
@Girgias Girgias deleted the remove-deprecated-alternative-syntax branch May 22, 2020 14:53
@carusogabriel carusogabriel added this to the PHP 8.0 milestone May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants