|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchessimplexml-fix-xml-header-for-clone.patch (last revision 2010-04-05 01:46 UTC by compuart dot php at gmail dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-12-30 14:49 UTC] rfludwick at gmail dot com
[2010-04-05 03:51 UTC] compuart dot php at gmail dot com
[2010-05-27 08:10 UTC] mike@php.net
-Status: Verified
+Status: Assigned
-Assigned To:
+Assigned To: rrichards
[2010-05-27 08:10 UTC] mike@php.net
[2010-05-27 11:09 UTC] rrichards@php.net
-Status: Assigned
+Status: Wont fix
[2010-05-27 11:09 UTC] rrichards@php.net
[2010-10-28 02:30 UTC] thedailynathan at gmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 02:00:01 2025 UTC |
Description: ------------ It appears that cloning a SimpleXML object will not produce the same XML output on asXML() as the original object. The original will output the XML header and a line break after the XML while the cloned object is missing these. Reproduce code: --------------- <?php $simplexml = new SimpleXMLElement("<root />"); $simplexml->path->to->node = "Zend"; $simplexml_2 = clone $simplexml; echo "|{$simplexml->asXML()}|\n|{$simplexml_2->asXML()}|"; Expected result: ---------------- |<?xml version="1.0"?> <root><path><to><node>Zend</node></to></path></root> | |<?xml version="1.0"?> <root><path><to><node>Zend</node></to></path></root> | Actual result: -------------- |<?xml version="1.0"?> <root><path><to><node>Zend</node></to></path></root> | |<root><path><to><node>Zend</node></to></path></root>|