|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28483 domxml elements unique ids changes when you call a method
Submitted: 2004-05-22 07:39 UTC Modified: 2004-05-24 00:10 UTC
From: vpupkin at comcast dot net Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 4.3.4 OS: Linux Fedora Core 1
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.
Block user comment
Status: Assign to:
Bug Type:
From: vpupkin at comcast dot net
New email:
PHP Version: OS:


 [2004-05-22 07:39 UTC] vpupkin at comcast dot net
a domxml element has "0" field where its unique id lays. When you call a method, those ids change, below is the code to reproduce this.

I used this XML string:
<?xml version="1.0"?>

Reproduce code:
$doc = domxml_open_file('test.xml');

//$element = $doc->first_child();

$xp = $doc->xpath_new_context();
$res = $xp->xpath_eval('//col', $xp);


Expected result:
comment/uncomment the 3rd line you'll see that ids change


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-24 00:10 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

The "0" field has nothing to do with an element. Every domxml object has this and its dependant upon when the object was created (calling an additional method returning and object would change the order of object creation).
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jan 23 15:01:23 2021 UTC