Skip to content

PHP 8.3: uopz_set_static() may cause segfaults #178

@cmb69

Description

@cmb69

Consider the following code:

const FOO = "a";

function foo() {
    static $a = FOO;
}

uopz_set_static("foo", ["a" => 42]);
var_dump(uopz_get_static("foo")["a"]);

foo();

Setting the static variable to 42 works fine, as the following var_dump() shows, but calling foo() triggers an assertion error in a debug build, and likely a segfault in release builds, as of PHP 8.3.0. With previous PHP versions the code works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions