Skip to content

Conversation

arnaud-lb
Copy link
Member

Fixes GH-16615.

We assert that Z_PROP_FLAG_P(retval) is exactly IS_PROP_UNINIT, but this is a bit field and it may contain irrelevant bits. For instance, props may also have the IS_PROP_LAZY or IS_PROP_REINITABLE bits, which does not change the fact that the property is uninitialized:

<?php

class Foo {
    public string $bar {
        set => $value;
    }
    public function __clone() {
        // Assertion failure
        echo $this->bar;
    }
}

clone new Foo();

@nielsdos I didn't update the comment because it's still correct, and I think that using equality comparison was unintended.

@arnaud-lb arnaud-lb changed the base branch from master to PHP-8.4 October 29, 2024 12:26
Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, silly mistake on my part. Thank you!

@arnaud-lb arnaud-lb closed this in 3d3b22d Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hooked properties combined with lazy ghosts cause an assertion failure

3 participants