php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26849 domXPath object returns array instead of nodeList
Submitted: 2004-01-08 16:18 UTC Modified: 2004-01-10 06:47 UTC
From: adam at trachtenberg dot com Assigned:
Status: Closed Package: DOM XML related
PHP Version: 5CVS-2004-01-08 (dev) OS: *
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: adam at trachtenberg dot com
New email:
PHP Version: OS:

 

 [2004-01-08 16:18 UTC] adam at trachtenberg dot com
Description:
------------
The domXPath object still returns nodes in an array 
instead of as a nodeList object.

Reproduce code:
---------------
$dom = new domDocument::load($xml);
$xpath = new domXPath($dom);
$results = $xpath->query('/');
var_dump($results);

Expected result:
----------------
object(domnodelist)#14 (0) {
 ...
}

Actual result:
--------------
array(1) {
 ...
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-08 16:22 UTC] adam at trachtenberg dot com
That should be domXpath::query(), but you get the point. 
:)
 [2004-01-10 06:47 UTC] rrichards@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 15:01:27 2025 UTC