|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
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: Wed Mar 03 14:01:24 2021 UTC