-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Deprecate using null as an array offset and when calling array_key_exists()
#19511
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: master
Are you sure you want to change the base?
Deprecate using null as an array offset and when calling array_key_exists()
#19511
Conversation
b1629ed
to
6b521a3
Compare
472c3c6
to
baeda1f
Compare
baeda1f
to
a6d44e0
Compare
d5fd9e5
to
a602268
Compare
Still a few tests to fix but we're getting closer |
6f50c89
to
e508fcc
Compare
8f22921
to
dc5049b
Compare
c47e2b5
to
58878be
Compare
2175fc1
to
636861f
Compare
636861f
to
34132a7
Compare
JIT really is something. But PR is now passing tests |
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 hate the extra state protections we have to do but I think we can simplify some of them.
This is why I don't like these kinds of deprecations, lots of pointless crap needs to be added to protect the engine. (Granted, this is not your fault, this is caused by a design problem of error handlers)
@@ -500,6 +500,31 @@ static void ZEND_FASTCALL zend_jit_fetch_dim_r_helper(zend_array *ht, zval *dim, | |||
} | |||
ZEND_FALLTHROUGH; | |||
case IS_NULL: | |||
/* The array may be destroyed while throwing the notice. |
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.
Please, no.
I would prefer if you just fetched the result first, copied it to the return value zval, and then emitted the deprecation. Similarly in many other places (this won't be possible for all code because some return a zval*
to the array slot).
Part of #19468
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_using_values_null_as_an_array_offset_and_when_calling_array_key_exists
cc @Girgias