Allow '??' on constant expressions#1868
Conversation
Zend/zend_ast.c
Outdated
| 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.
^ is zend_fetch_dimension_address_UNSET the proper way to achieve this here?
There was a problem hiding this comment.
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