-
Notifications
You must be signed in to change notification settings - Fork 8k
Core: fix missing deprecation when accessing null array key with JIT #20883
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
base: PHP-8.5
Are you sure you want to change the base?
Core: fix missing deprecation when accessing null array key with JIT #20883
Conversation
535d9f3 to
225faac
Compare
dstogov
left a comment
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.
See minor note.
Everything else looks fine.
225faac to
7522b0c
Compare
7522b0c to
681ef28
Compare
| static inline zend_result ct_eval_isset_dim(zval *result, uint32_t extended_value, zval *op1, zval *op2) { | ||
| if (Z_TYPE_P(op2) == IS_NULL) { | ||
| return FAILURE; | ||
| } |
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 this still necessary? Shouldn't fetch_array_elem() already handle it?
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 would say it is. If op1 is not an array (e.g. isset($a[null])), the condition below this one (if (Z_TYPE_P(op1) == IS_ARRAY || IS_PARTIAL_ARRAY(op1)) {) would be false and we would completely ditch any check on a null key.
Adding this early return avoids compile-time checks that would silence this kind of operation. If I get it right 😄
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.
The deprecation was only added for arrays though, as far as I understand.
Missing deprecation raised in #20857