-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Allow '??' on constant expressions #1868
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
zend_fetch_dimension_by_zval(&tmp, &op1, &op2); | ||
if (ast->attr == ZEND_DIM_UNSET) { | ||
/* @TODO fetch index without throwing the notice at Zend/zend_execute.c:1596 */ | ||
/* zend_fetch_dimension_address_UNSET(&tmp, &op1, &op2, IS_TMP_VAR); */ |
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.
^ is zend_fetch_dimension_address_UNSET
the proper way to achieve this here?
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.
shouldn't that actually be an IS fetch?
@laruence should we really require RFC? This fits more in the 'bug' camp to me. |
Nope, that looks like an oversight; there's definitely no ground for a RFC here. |
okey, mark as bug |
99bc5cc
to
eaecc3e
Compare
What is this useful for? I have hard time seeing for what one would use such thing? |
@smalyshev if |
@smalyshev constants can be arrays. May be useful in that case. Also, this is not a question of why but rather of completeness. |
There should always be a question of why. But constant arrays looks like a good case, those can be defined elsewhere, that makes sense. |
@bwoebi should be okay now :) |
Comment on behalf of bwoebi at php.net: Merged via 672a995 |
Wrong commit, meant 9f3eab4... |
It looks like we forgot to allow the null coalesce operator on constant expressions https://3v4l.org/LoPsg:
Reference https://wiki.php.net/rfc/const_scalar_exprs