|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
44 + 41 = ?
Subscribe to this entry?

 [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: Fri Apr 10 10:01:24 2020 UTC