1--TEST--
2compareDocumentPosition: equal nodes
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$dom = new DOMDocument();
9$dom->loadXML(<<<XML
10<?xml version="1.0"?>
11<container>
12<p>foo</p>
13<p>foo</p>
14</container>
15XML);
16
17$xpath = new DOMXPath($dom);
18$nodes = $xpath->query('//p');
19var_dump($nodes->item(0)->compareDocumentPosition($nodes->item(0)) === 0);
20var_dump($nodes->item(1)->compareDocumentPosition($nodes->item(1)) === 0);
21var_dump($nodes->item(0)->compareDocumentPosition($nodes->item(1)) === 0);
22var_dump($nodes->item(1)->compareDocumentPosition($nodes->item(0)) === 0);
23
24?>
25--EXPECT--
26bool(true)
27bool(true)
28bool(false)
29bool(false)
30