From: c dot d at earthlink dot net
Operating system: Mac OS X 10.3.8
PHP version: 5.0.3
PHP Bug Type: DOM XML related
Bug description: DOMDocument::createElement changes property value
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 bug report at http://bugs.php.net/?id=32472&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32472&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=32472&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=32472&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32472&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32472&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32472&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32472&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32472&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32472&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32472&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=32472&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=32472&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32472&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32472&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32472&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32472&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32472&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32472&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32472&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32472&r=mysqlcfg