|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71526 SimpleXML different results with whitespace
Submitted: 2016-02-04 22:14 UTC Modified: 2016-11-27 14:18 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: jacob dot mroz at gmail dot com Assigned: cmb (profile)
Status: Duplicate Package: SimpleXML related
PHP Version: 5.5.32 OS: CentOS release 6.7 (Final)
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: jacob dot mroz at gmail dot com
New email:
PHP Version: OS:


 [2016-02-04 22:14 UTC] jacob dot mroz at gmail dot com
Adding spaces changes the internal representation of a SimpleXMLElement.

If you change the value of c to add a space, '\n', or an additional node <x2/> after  the node <x/>, you get the correct output.  

Test script:

Expected result:
class SimpleXMLElement#2 (1) {
  public $x =>
  class SimpleXMLElement#3 (0) {

Actual result:
class SimpleXMLElement#2 (1) {
  public ${0} =>
  class SimpleXMLElement#3 (1) {
    public $x =>
    class SimpleXMLElement#4 (0) {


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-17 18:02 UTC]
-Assigned To: +Assigned To: cmb
 [2016-07-17 18:02 UTC]
Appears to have been fixed in the meantime: <> and <>.

Might be related to bug #70905.
 [2016-11-27 14:18 UTC]
-Status: Assigned +Status: Duplicate
 [2016-11-27 14:18 UTC]
The misbehavior had been introduced with commit 5683b6fa[1] (PHP
5.5.27 and 5.6.11), and has been fixed with commit 8ca02bb2[2]
(PHP 5.6.20).

This ticket is actually a duplicate of bug #66084.

[1] <;a=commit;h=5683b6fa> 
[2] <;a=commit;h=8ca02bb2>
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 00:01:33 2024 UTC