Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix GH-15123: var_dump doesn't actually work on XMLReader #15130

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

Merged
nielsdos merged 1 commit into php:master from nielsdos:fix-15123
Jul 28, 2024

Conversation

Copy link
Member

@nielsdos nielsdos commented Jul 27, 2024

Targeting master because it changes long standing behaviour, although what it currently does is useless anyway...

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.

It seems a bit strange to have initialized properties when the object is actually not initialized?

Copy link
Member Author

It seems a bit strange to have initialized properties when the object is actually not initialized?

Perhaps uninitialized isn't the right word. The error basically happens because you're reading a the isEmptyElement property before actually reading anything. The fact that other properties are able to be read is perhaps a bit weird (except for properties like depth maybe) but changing that would be a painful BC break.

Copy link
Member

Girgias commented Jul 28, 2024

Ah okay, yeah I think the error wording maybe should be improved then, as I thought it was similar to a DateTime object not being properly initialized

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.

Not sure what to do about the error message, but the rest seems OK

Copy link
Member Author

What about something like "Failed to read property because no XML data has been read yet" ?

Copy link
Member

Girgias commented Jul 28, 2024

I think that is indeed a better error message! :)

nielsdos reacted with thumbs up emoji

@nielsdos nielsdos merged commit e0a2e2e into php:master Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@Girgias Girgias Girgias approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

var_dump doesn't actually work on XMLReader
2 participants

AltStyle によって変換されたページ (->オリジナル) /