Skip to content

dl("mysqli") fails when OPcache is enabled #8508

Closed
@cmb69

Description

@cmb69

Description

The following code:

<?php
dl("mysqli");

Resulted in this output:

Fatal error: Internal zvals cannot be refcounted in Unknown on line 0

But I expected this output instead:

The problem is mysqli_exception::$sqlstate; its value "00000" won't would be interned, and so the respective check

php-src/Zend/zend_API.c

Lines 3814 to 3816 in 95f5f9d

if (Z_REFCOUNTED_P(property)) {
zend_error_noreturn(E_CORE_ERROR, "Internal zvals cannot be refcounted");
}

fails, causing PHP to bail out.

This is particularly an issue regarding the tests, because as of PHP 8.1.0, run-tests.php tries to figure out which dynamic extension can be loaded to gather the $exts_to_tests; however, due to this issue the list is not complete, so when OPcache is enabled, about 2.000 tests are not executed on AppVeyor CI.

PHP Version

PHP-8.0

Operating System

Windows

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