3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = <<<DATA <a> <a1> <author pid = "123"> </author> <book>Book1</book> </a1> <a1> <author pid = "123"> </author> <book>Book1</book> </a1> <a2> <editor pid = "123"> </editor> <book>Book2</book> </a2> </a> DATA; $abc= new DomDocument(); $abc->loadXML($data); $xpath = new DOMXPath($abc); $venue = "Book1"; $expr = "/a/*[self::a1 or self::a2]/*[self::author or self::editor][@pid=\"123\"]/following-sibling::book[normalize-space(text()) = '" . $venue . "']"; $xyz = $xpath->query($expr); echo $xyz->length;
Output for git.master, git.master_jit, rfc.property-hooks
2

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
120.37 ms | 405 KiB | 5 Q