|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-10-25 01:58 UTC] yohgaki at ohgaki dot net
[2011-10-25 04:15 UTC] yohgaki at ohgaki dot net
-Status: Open
+Status: Closed
[2011-10-25 04:15 UTC] yohgaki at ohgaki dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 05:00:02 2025 UTC |
Description: ------------ Updating node value result inserting selected node. PHP should update value, NOT inserting selected node. This bug is located at ext/simplexml.c static int sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_bool elements, zend_bool attribs, xmlNodePtr *pnewnode TSRMLS_DC) It seems the logic is broken for this case. Test script: --------------- <?php $string = <<<XML <?xml version="1.0" ?> <root> <node> value </node> </root> XML; $xml = simplexml_load_string($string); $xml->root->node = "NEW VALUE"; print $xml->asXML(); Expected result: ---------------- <?xml version="1.0"?> <root> <node> value </node> <root><node>NEW VALUE</node></root></root> Actual result: -------------- <?xml version="1.0"?> <root> <node> NEW VALUE </node> </root>