Skip to content

ext-oci8: oci_new_descriptor() triggers dynamic property deprecation #8756

Description

@derrabus

Description

The following code:

https://github.com/doctrine/dbal/blob/e15d05d08172ceeb4f55066feed48d688fdb0250/src/Driver/OCI8/Statement.php#L75

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

  1. adoy commented on Jun 12, 2022

    @adoy
    Member

    @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.

  2. derrabus commented on Jun 13, 2022

    @derrabus
    ContributorAuthor

    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 and collection) directly.

  3. adoy commented on Jun 13, 2022

    @adoy
    Member

    @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 ?

  4. cmb69 commented on Jun 13, 2022

    @cmb69
    Member

    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.

  5. derrabus commented on Jun 23, 2022

    @derrabus
    ContributorAuthor

    The deprecation warnings are gone now. Thank you!

  6. adoy commented on Jun 23, 2022

    @adoy
    Member

    Welcome. Thanks for reporting

  7. dormadekhin commented on Mar 28, 2023

    @dormadekhin

    Hi! After installing php 8.2 I keep getting the following error:
    Creation of dynamic property OCILob::$descriptor is deprecated

  8. adoy commented on Mar 28, 2023

    @adoy
    Member

    Hi! After installing php 8.2 I keep getting the following error: Creation of dynamic property OCILob::$descriptor is deprecated

    What exact version of PHP are you using ? Can you narrow it to a small reproducible script?

  9. dormadekhin commented on Mar 28, 2023

    @dormadekhin

    Hi! After installing php 8.2 I keep getting the following error: Creation of dynamic property OCILob::$descriptor is deprecated

    What exact version of PHP are you using ? Can you narrow it to a small reproducible script?

    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

    image
    image

  10. dormadekhin commented on Mar 30, 2023

    @dormadekhin

    I use php in a container, based on the basic php-fpm image
    FROM php:8.2-fpm

  11. derrabus commented on Mar 30, 2023

    @derrabus
    ContributorAuthor

    I think, the important part was:

    Can you narrow it to a small reproducible script?

  12. BigOHenry commented on Apr 5, 2023

    @BigOHenry

    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

  13. adoy commented on Apr 23, 2023

    @adoy
    Member

    @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.

    PHP Version => 8.2.4
    OCI8 Version => 3.2.1
    Oracle Run-time Client Library Version => 21.6.0.0.0
    Oracle Compile-time Instant Client Version => 21.6
    

    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:

    <?php
    
    foreach ([ OCILob::class, OCICollection::class ] as $cn) {
            $rc = new ReflectionClass($cn);
            foreach ($rc->getAttributes() as $attribute) {
                    var_dump($attribute->getName());
            }
    }
    
    $x = new OCILob();
    $x->foo = 'bar';
    
    $y = new OCICollection();
    $y->foo = 'bar';

    @derrabus Do you also have the same issue ?

  14. derrabus commented on Apr 23, 2023

    @derrabus
    ContributorAuthor

    No, from my POV, the issue has been resolved.

  15. BigOHenry commented on Apr 24, 2023

    @BigOHenry

    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);

    obrazek

    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)

  16. BigOHenry commented on Apr 25, 2023

    @BigOHenry

    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!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions