|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67387 SimpleXMLElement asXML() and saveXML() ignore LIBXML_NOXMLDECL
Submitted: 2014-06-05 13:57 UTC Modified: 2016-10-14 15:27 UTC
Avg. Score:3.5 ± 0.9
Reproduced:20 of 20 (100.0%)
Same Version:3 (15.0%)
Same OS:10 (50.0%)
From: anthon at piwik dot org Assigned:
Status: Open Package: SimpleXML related
PHP Version: 5.5.13 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: anthon at piwik dot org
New email:
PHP Version: OS:


 [2014-06-05 13:57 UTC] anthon at piwik dot org
asXML() and saveXML() includes the XML declaration contrary to

Drop the XML declaration when saving a document

(#50989 is similar to this bug but was reported for DOMDocument.)

Test script:
$xml = new \SimpleXMLElement('<root/>', LIBXML_NOXMLDECL);

Expected result:
string(8) "<root/>

Actual result:
string(30) "<?xml version="1.0"?>


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-10-14 15:27 UTC]
Related to bug #50989.
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Sep 22 04:01:25 2019 UTC