-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix return type of DOMNodeList::item()
It can also return DOMNameSpaceNode :(
- Loading branch information
Showing
3 changed files
with
42 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--TEST-- | ||
DOMXPath::query() can return DOMNodeList with DOMNameSpaceNode items | ||
--FILE-- | ||
<?php | ||
|
||
$xml = <<<'XML' | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<test></test> | ||
XML; | ||
$doc = new DomDocument; | ||
$doc->loadXML($xml); | ||
$xpath = new DOMXPath($doc); | ||
$nodes = $xpath->query('//namespace::*'); | ||
var_dump($nodes->item(0)); | ||
|
||
?> | ||
--EXPECT-- | ||
object(DOMNameSpaceNode)#3 (8) { | ||
["nodeName"]=> | ||
string(9) "xmlns:xml" | ||
["nodeValue"]=> | ||
string(36) "http://www.w3.org/XML/1998/namespace" | ||
["nodeType"]=> | ||
int(18) | ||
["prefix"]=> | ||
string(3) "xml" | ||
["localName"]=> | ||
string(3) "xml" | ||
["namespaceURI"]=> | ||
string(36) "http://www.w3.org/XML/1998/namespace" | ||
["ownerDocument"]=> | ||
string(22) "(object value omitted)" | ||
["parentNode"]=> | ||
string(22) "(object value omitted)" | ||
} |