-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Conversation
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? |
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@. |
4ab82a8
to
8f5ecf6
Compare
8f5ecf6
to
b0327b9
Compare
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"); | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
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)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK.
7ad85b2
to
37a5ca6
Compare
37a5ca6
to
fe76690
Compare
If there are no objections I'll merge this in a week |
Zend/zend_compile.c
Outdated
@@ -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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
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
fe76690
to
53af2b8
Compare
53af2b8
to
23302c0
Compare
No description provided.