php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32472 DOMDocument::createElement changes property value
Submitted: 2005-03-28 13:12 UTC Modified: 2005-03-29 01:20 UTC
From: c dot d at earthlink dot net Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 5.0.3 OS: Mac OS X 10.3.8
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: c dot d at earthlink dot net
New email:
PHP Version: OS:

 

 [2005-03-28 13:12 UTC] 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" }



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-29 01:17 UTC] c dot d at earthlink dot net
I'm using the Entropy 5.0.3 rev. 4 release. I'm sorry, but I just don't know enough about building it myself. Pretty much any time I have for programming I have to devote to php.

However, apparently 5.0.4 is emminent (according to php.internals). So I'll report the results with that release when it becomes available from the Entropy site.
 [2005-03-29 01:20 UTC] sniper@php.net
Sorry but we don't support any binary releases except for the win32 ones.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 17:01:29 2024 UTC