|  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
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: 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-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 13:01:29 2024 UTC