|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69491 simplexml doesn't correctly parse empty nodes on same line as another node
Submitted: 2015-04-21 02:33 UTC Modified: 2015-05-27 17:50 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: ray dot ward at bigcommerce dot com Assigned: cmb (profile)
Status: Duplicate Package: SimpleXML related
PHP Version: 5.6.8 OS: Debian
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: ray dot ward at bigcommerce dot com
New email:
PHP Version: OS:


 [2015-04-21 02:33 UTC] ray dot ward at bigcommerce dot com
This is very similar to

When an empty node is within another node on the same line of a multi-line xml file, the empty node name gets parsed as an integer.

If the empty node gets moved to its own line, then it gets parsed correctly.

This previously worked in PHP 5.3, now fails in 5.4, 5.5 and 5.6.

Test script:




Expected result:
object(SimpleXMLElement)#1 (1) {
  object(SimpleXMLElement)#3 (1) {
    object(SimpleXMLElement)#2 (0) {

Actual result:
object(SimpleXMLElement)#1 (1) {
  object(SimpleXMLElement)#3 (1) {
    object(SimpleXMLElement)#2 (0) {


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-24 01:15 UTC]
-Status: Open +Status: Verified
 [2015-04-24 01:15 UTC]
Compare <> vs. <>.
 [2015-04-24 03:13 UTC] ray dot ward at bigcommerce dot com
The issue looks like it can be generalised to just problems with whitespace parsing, rather than lines.

 [2015-05-27 17:50 UTC]
-Status: Verified +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2015-05-27 17:50 UTC]
After further investigation it turned out that this is a duplicate
of bug #66084.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Apr 08 03:01:24 2020 UTC