Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
alexandre-daubois wants to merge 2 commits into php:PHP-8.5
base: PHP-8.5
Choose a base branch
Loading
from alexandre-daubois:jit-array-null-key

Conversation

@alexandre-daubois
Copy link
Member

@alexandre-daubois alexandre-daubois commented Jan 9, 2026

Missing deprecation raised in #20857

Copy link
Member

@dstogov dstogov left a 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.

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;
}
Copy link
Member

@iluuu1994 iluuu1994 Jan 12, 2026

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?

Copy link
Member Author

@alexandre-daubois alexandre-daubois Jan 12, 2026

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 😄

Copy link
Member

@iluuu1994 iluuu1994 Jan 12, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@iluuu1994 iluuu1994 iluuu1994 left review comments

@dstogov dstogov dstogov approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /