|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40451 Using addAttribute() on a child named "Host" causes error.
Submitted: 2007-02-12 20:48 UTC Modified: 2007-02-12 21:06 UTC
From: jonas at carello dot se Assigned:
Status: Closed Package: SimpleXML related
PHP Version: 5.2.1 OS: Windows 2003
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: jonas at carello dot se
New email:
PHP Version: OS:


 [2007-02-12 20:48 UTC] jonas at carello dot se
Tested on PHP 5.1.3 -> 5.2.1

Using addAttribute() when referring to a child called "Host" causes PHP to return a CGI Error.

Reproduce code:
$string = <<<XML
<?xml version="1.0"?>
<Host enable="true">

$xml = simplexml_load_string($string);

$add = $xml->addChild('Host');
$add->Host->addAttribute('enable', 'true');

Expected result:
Running it should add a child called "Host" and add the attribute "enable" with the value "true".

Actual result:
$add = $xml->addChild('Host') works fine.
Adding an attribute to a child named "Host" however, results in:
"The specified CGI application misbehaved by not returning a complete set of HTTP headers."


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-12 21:06 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 30 11:01:31 2024 UTC