[GIT-PULLS] [php-src] PR #23500: [SimpleXML] Fix creating new attributes via attributes() dimension write

[email protected] (iliaal)
Newsgroups php.git-pulls
Message-ID <[email protected]>
Pull Request: https://github.com/php/php-src/pull/23500
Author: iliaal

Dimension writes like $x->attributes()["new"] = "v" did nothing for a not-yet-existing attribute, because sxe_prop_dim_write() replaced the element node with the first attribute node while resolving an SXE_ITER_ATTRLIST iterator, so xmlNewProp() hit a non-element node or never ran when the element had no attributes. sxe_prop_dim_write() now keeps the element node and resolves only the start of the attribute list, making dimension writes on attributes() behave like $x["new"] = "v". Property writes share this path and are fixed too; read, exists, and unset create nothing and are unaffected.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.