|  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
 [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: Sun May 26 13:01:32 2024 UTC