Skip to content

Conversation

@iluuu1994
Copy link
Member

Also fix incorrect usage of zend_read_property_ex().

Fixes GH-15187

@iluuu1994
Copy link
Member Author

iluuu1994 commented Aug 13, 2024

Actually, there's another issue:

class Test {
    public int $prop { set => $value; }
}

$test = new Test();
var_dump($test);
foreach ($test as $key => $value) {
    var_dump($key, $value);
}

This currently prints NULL, but the property should be skipped instead... I'll have a look tomorrow.

@iluuu1994
Copy link
Member Author

Ok, both issues should be fixed now. I changed the implementation to set data/key to null on reset/forward, and fetch the data (if it wasn't already) on valid/get_current_data. Fetching the data includes moving forward further if the data is unavailable, both for declared and dynamic properties.

Copy link
Member

@arnaud-lb arnaud-lb left a comment

Choose a reason for hiding this comment

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

Looks good to me apart from one comment

@iluuu1994 iluuu1994 merged commit 60f87f2 into php:master Aug 19, 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.

Segmentation fault (access illegal address) in zend allocator

2 participants