Skip to content

Fix GH-10200 (zif_get_object_vars: Assertion `!(((__ht)->u.flags & (1<<2)) != 0)' failed.) #10209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Jan 2, 2023

Analysis is in GH-10200.
This restores the behaviour of PHP<8.2.

I manually checked the other places where 90b7bde made modifications, but they look alright to me. I think this is the only bug that was introduced back then.

One little oddity remains (that was already present in older PHP versions):
According to the man page of get_object_vars:

Returns an associative array of defined object accessible non-static properties for the specified object in scope.

I guess that might be a bit confusing because for example we can see in the test example here the keys are all integer indices.

nielsdos and others added 2 commits January 2, 2023 15:34
… (1<<2)) != 0)' failed.

This occurs because the array of properties is a single element with an
integer key, not an associative array. Therefore it is a packed array
and thus the assumption the iteration macro makes is invalid.

This restores the behaviour of PHP<8.2.

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
Co-authored-by: Deltik <deltik@gmx.com>
Girgias pushed a commit that referenced this pull request Jan 2, 2023
…<<2)) != 0)' failed.

This occurs because the array of properties is a single element with an
integer key, not an associative array. Therefore it is a packed array
and thus the assumption the iteration macro makes is invalid.

This restores the behaviour of PHP<8.2.

Closes GH-10209

Co-authored-by: Deltik <deltik@gmx.com>

Signed-off-by: George Peter Banyard <girgias@php.net>
@Girgias Girgias closed this in a3d2c33 Jan 2, 2023
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.

None yet

2 participants