Skip to content
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

Fix GH-17198: SplFixedArray assertion failure with get_object_vars #17206

Closed
wants to merge 1 commit into from

Conversation

nielsdos
Copy link
Member

Because the properties table contains both a numeric index and a string index that map to 0 in a symbol table, this causes an assertion failure. Looking at the manual page of get_object_vars(), it seems that only real properties must be included. Given that SplFixedArray's elements are not accessible like properties, they should be excluded. This restores PHP 8.3 behaviour. The reason that this didn't cause problems on 8.3 is because it used a different handler (get_properties).

Because the properties table contains both a numeric index and a string
index that map to 0 in a symbol table, this causes an assertion failure.
Looking at the manual page of get_object_vars(), it seems that only real
properties must be included. Given that SplFixedArray's elements are not
accessible like properties, they should be excluded. This restores PHP
8.3 behaviour. The reason that this didn't cause problems on 8.3 is
because it used a different handler (get_properties).
@nielsdos nielsdos requested a review from Girgias as a code owner December 17, 2024 21:05
@nielsdos nielsdos linked an issue Dec 17, 2024 that may be closed by this pull request
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

mstm

@nielsdos nielsdos closed this in 5f13c62 Dec 17, 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.

SplFixedArray assertion failure with get_object_vars
2 participants