-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Fix GH-8756 : oci_new_descriptor() triggers dynamic property deprecation #8758
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?
Conversation
I don't know much about Are those properties usable ? I mean does it make sense to expose this ? From what I see the extension always use the classes If making those resources visible make sense, it's currently possible to |
Good questions. Need to refresh my memory and investigate. |
Makes sense to me. |
Fix phpGH-8756 : oci_new_descriptor() triggers dynamic property deprecation. This fix should be temporary. At some point we should either define those properties or just hide them since they should probably not be used. Better fix is here : php#8758 but waiting feedback from Oracle team before going ahead.
Fix phpGH-8756 : oci_new_descriptor() triggers dynamic property deprecation. This fix should be temporary. At some point we should either define those properties or just hide them since they should probably not be used. Better fix is here : php#8758 but waiting feedback from Oracle team before going ahead.
6b6e5f3 should be reverted in this PR |
Next step will be to refactor the code to change those error messages and also maybe to remove the useless temp variables.
@@ -233,7 +236,8 @@ PHP_FUNCTION(oci_free_descriptor) | |||
RETURN_THROWS(); | |||
} | |||
|
|||
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) { | |||
tmp = Z_OCILOB_DESCRIPTOR_P(z_descriptor); |
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.
Based on php_soap_deref
added in https://github.com/php/php-src/commit/50484b59cd4ff5a1d32ce520fc7a7181b25ed0d9
, I'd guess that these properties could benefit from dereferencing (pls double check it)
@@ -42,6 +42,9 @@ typedef ub8 oci_phpsized_int; | |||
typedef ub4 oci_phpsized_int; | |||
#endif | |||
|
|||
#define Z_OCILOB_DESCRIPTOR_P(zv) OBJ_PROP_NUM(Z_OBJ_P(zv), 0) |
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.
IMO these macros should be added to the php_oci8_int.h header instead if they has to be shared internally.
class OCILob { | ||
/** @var resource */ | ||
public mixed $descriptor = null; |
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.
as far as I managed to understand, the property is private indeed as you guessed... Would be nice to double check with someone else and change the visibility accordingly. If someone later complains, we can still make it public
again.
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.
Yep that's why I asked @cjbj for a confirmation. I'm not an OCI user and looking at some tests I see stuff like unset($clob->descriptor);
.
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 won't have time to look at this until next month :(
Fix GH-8756