#32472 [Opn->Fbk]: DOMDocument::createElement changes property value
| From: | rrichards@php.net | Date: | Mon, 28 Mar 2005 11:22:09 +0000 |
| Subject: | #32472 [Opn->Fbk]: DOMDocument::createElement changes property value | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-75927@lists.php.net to get a copy of this message | ||
ID: 32472
Updated by: rrichards@php.net
Reported By: c dot d at earthlink dot net
-Status: Open
+Status: Feedback
Bug Type: DOM XML related
Operating System: Mac OS X 10.3.8
PHP Version: 5.0.3
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.0-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2005-03-28 13:12:16] c dot d at earthlink dot net
Description:
------------
I'm using libxml2 2.6.17.
In the following code, the call to createElement() changes the value of
the private property $rootTag to null.
Reproduce code:
---------------
<?php
ini_set('display_errors', '1');
error_reporting(E_ALL | E_STRICT);
class bdmDOMTable extends DOMDocument
{
private $rootTag;
private $rowTag;
public function __construct($rootTag, $rowTag)
{
parent::__construct('1.0', 'UTF-8');
$this->preserveWhiteSpace = FALSE;
$this->formatOutput = FALSE;
if ($rootTag) {
$this->rootTag = $rootTag;
}
else {
$this->rootTag = 'table';
}
if ($rowTag) {
$this->rowTag = $rowTag;
}
else {
$this->rowTag = 'row';
}
$this->appendChild($this->createElement($this->rootTag));
}
}
$modulesDOM = new bdmDOMTable('modules', 'module');
var_dump($modulesDOM);
?>
Expected result:
----------------
object(bdmDOMTable)#1 (2) { ["rootTag:private"]=> string(7) "modules"
["rowTag:private"]=> string(6) "module" }
Actual result:
--------------
object(bdmDOMTable)#1 (2) { ["rootTag:private"]=> NULL
["rowTag:private"]=> string(6) "module" }
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32472&edit=1