3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<EOF <!doctype html> <html> <head> <link href='http://wendyandgabe.blogspot.com/favicon.ico' rel='icon' type='image/x-icon'/> <link href='http://wendyandgabe.blogspot.com/' rel='canonical'/> <link rel="alternate" type="application/atom+xml" title="O&#39; Happy Day! - Atom" href="http://wendyandgabe.blogspot.com/feeds/posts/default" /> <link rel="alternate" type="application/rss+xml" title="O&#39; Happy Day! - RSS" href="http://wendyandgabe.blogspot.com/feeds/posts/default?alt=rss" /> <link rel="service.post" type="application/atom+xml" title="O&#39; Happy Day! - Atom" href="http://www.blogger.com/feeds/5390468261501503598/posts/default" /> </head> <body> </body> </html> EOF; $xml = new DomDocument; $xml->loadXML($html); //create a xpath instance $xpath = new DomXpath($xml); //query for <sub name="Y"> and use the first found item $link = $xpath->query('//link[@type="application/rss+xml"]')->item(0); var_dump($link->getAttribute('href'));
Output for git.master, git.master_jit, rfc.property-hooks
Warning: DOMDocument::loadXML(): StartTag: invalid element name in Entity, line: 1 in /in/Nhhvd on line 19 Warning: DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 1 in /in/Nhhvd on line 19 Fatal error: Uncaught Error: Call to a member function getAttribute() on null in /in/Nhhvd:28 Stack trace: #0 {main} thrown in /in/Nhhvd on line 28
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:
43.32 ms | 401 KiB | 8 Q