Description
Description
The following code:
Resulted in this output:
Creation of dynamic property OCILob::$descriptor is deprecated
https://github.com/doctrine/dbal/runs/6850136105?check_suite_focus=true
But I expected this output instead:
The piece of code that PHP complains about does not write any property directly but calls oci_new_descriptor()
which is supposed to return a new OCILob
instance. I don't feel like I could avoid the deprecation.
PHP Version
PHP 8.2-dev 13479ee
Operating System
Ubuntu 20.04
Activity
adoy commentedon Jun 12, 2022
@derrabus Thanks. I started to work on a patch for your issue. I'm not a user of oci extension myself so if you have the oportunity to make sure the patch work and also to give some input on GH-8756, that would be appreciated.
derrabus commentedon Jun 13, 2022
Thank you very much for working on this. I don't use that extension much myself either. I help maintaining Doctrine DBAL and this issue bubbled up in our CI. 🙈
But as far as I can tell, DBAL never accesses those properties (
descriptor
andcollection
) directly.adoy commentedon Jun 13, 2022
@derrabus Thanks. I'll wait for answers on the code review. Would it be possible for you to run your test suite on the branch with the current fix ?
cmb69 commentedon Jun 13, 2022
We need to test oci8 and pdo_oci in our CI; there is #8348, but that needs more work. I doubt that a setup on AppVeyor makes sense, since the latest Oracle XE download is almost 2GB, and it is not yet preinstalled.
Add AllowDynamicProperties on OCILob and OCICollection
Add AllowDynamicProperties on OCILob and OCICollection
derrabus commentedon Jun 23, 2022
The deprecation warnings are gone now. Thank you!
adoy commentedon Jun 23, 2022
Welcome. Thanks for reporting
dormadekhin commentedon Mar 28, 2023
Hi! After installing php 8.2 I keep getting the following error:
Creation of dynamic property OCILob::$descriptor is deprecated
adoy commentedon Mar 28, 2023
What exact version of PHP are you using ? Can you narrow it to a small reproducible script?
dormadekhin commentedon Mar 28, 2023
PHP Version 8.2.4
OCI8 Version 3.2.1
Oracle Run-time Client Library Version 21.3.0.0.0
Oracle Compile-time Instant Client Version 21.3
dormadekhin commentedon Mar 30, 2023
I use php in a container, based on the basic php-fpm image
FROM php:8.2-fpm
derrabus commentedon Mar 30, 2023
I think, the important part was:
BigOHenry commentedon Apr 5, 2023
Same problem here.
PHP Version 8.2.4
OCI8 Version 3.2.1
Oracle Run-time Client Library Version 21.1.0.0.0
Oracle Compile-time Instant Client Version 21.1
based on php:8.2.4-apache-bullseye
adoy commentedon Apr 23, 2023
@dormadekhin @BigOHenry I took some time to look at the issue but wasn't able to reproduce it. I tried first using the official 8.2.5 source code, then built a docker image based on php:8.2.4-apache-bullseye as you suggested and both of them worked.
Could you provide me a minimal script to reproduce the error, and how you built the image ? That would be helpful.
Also what's the output when you run a script like this:
@derrabus Do you also have the same issue ?
derrabus commentedon Apr 23, 2023
No, from my POV, the issue has been resolved.
BigOHenry commentedon Apr 24, 2023
I will try prepare the image this week (kind of busy right now).
But for now. I getting the OCI error on every oci_fetch_array call, when there is a CLOB column:
oci_fetch_array($res, OCI_ASSOC | OCI_RETURN_NULLS);
EDIT: Just found new version of oci8 php extension for php8.2 (released 4 days ago). I will try it, it could be fixed (dont know if error is caused by php or oci8)
BigOHenry commentedon Apr 25, 2023
I made some test with new oci8 (3.3.0) and with php8.2.5 and it seems the issue is solved. Thank you for your time!