Skip to content

Fix GH-21583: SimpleXML empty element incorrectly casts to true.#21590

Draft
devnexen wants to merge 1 commit intophp:PHP-8.4from
devnexen:gh21583
Draft

Fix GH-21583: SimpleXML empty element incorrectly casts to true.#21590
devnexen wants to merge 1 commit intophp:PHP-8.4from
devnexen:gh21583

Conversation

@devnexen
Copy link
Copy Markdown
Member

No description provided.

@ndossche
Copy link
Copy Markdown
Member

This changes very long standing behaviour. The current behaviour is here since PHP 5.1.x. PHP 5.0.x had different behaviour, closer to what you propose in the PR but not quite the same.
Since this is changing such old behaviour this can only go into master.
I'm also not so sure whether this should be fixed in the code or if this is a documentation mistake. The new code makes more sense than what it was because now it is similar to a string cast followed by a bool cast.
It raises the question though why the current behaviour is what it is.

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.

SimpleXML: empty child element without attributes casts to true instead of false

2 participants