|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-03-28 13:22 UTC] rrichards@php.net
[2005-03-29 01:17 UTC] c dot d at earthlink dot net
[2005-03-29 01:20 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 24 00:00:01 2025 UTC |
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" }