--TEST-- XPath: with a context node --EXTENSIONS-- dom --FILE-- loadXML(<<

bar

foo1

foo2

XML); $xpath = new DOMXpath($dom); foreach ($xpath->query("p", $dom->documentElement->firstElementChild->nextElementSibling) as $p) { echo $p->textContent, "\n"; } var_dump($xpath->evaluate("count(p)", $dom->documentElement->firstElementChild->nextElementSibling)); ?> --EXPECT-- foo1 foo2 float(2)