3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0" encoding="UTF-8"?> <root> <item id="images"> <images handle="kings-of-leon_poster_v02_webjpg" path="workspace/assets/uploads/" type="file">kings of leon_poster_v02_WEB.jpg</images> </item> <item id="about"> <page-name handle="new-age" type="page-name">New Age</page-name> </item> <item id="about"> <page-name handle="new-age-2" type="page-name">New Age 2</page-name> </item> <item id="images"> <images handle="aae_seating-plan_v01jpg" path="workspace/assets/uploads/" type="file">AAE_Seating-plan_v01.jpg</images> </item> <item id="images"> <images handle="evidence-of-communication-between-myself-and-external-sourcespng" path="workspace/assets/uploads/" type="file">evidence-of-communication-between-myself-and-external-sources.png</images> </item> </root> '; $dom = new DOMDocument; $dom->loadXML($xml); //var_dump($dom); $xpath = new DOMXPath($dom); $res1 = $xpath->query('//root/item[@id="images"]/descendant::*[./@handle = "kings-of-leon_poster_v02_webjpg"]'); var_dump($res1->getElementsByTagName('item')->item(0)); foreach($res1 as $res){ var_dump($res); } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined method DOMNodeList::getElementsByTagName() in /in/Sk9h3:30 Stack trace: #0 {main} thrown in /in/Sk9h3 on line 30
Process exited with code 255.

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:
42.91 ms | 401 KiB | 8 Q