3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<EOD <rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0"> <media:content medium="media.medium" href="<img src='http://res.cloudinary.com/cermati/image/upload/c_fill,h_300,w_300/ctjaru9g6c7lowxifxol' height='300' width='300'/>" height="300" width="300"> <media:thumbnail medium="media.thumb.medium" href="<img src='http://res.cloudinary.com/cermati/image/upload/c_thumb,h_120,w_120/ctjaru9g6c7lowxifxol' height='120' width='120'/>" height="120" width="120"/> </media:content> </rss> EOD; $sxe = new SimpleXMLElement($xml); $sxe->registerXPathNamespace('c', 'http://example.org/chapter-title'); $result = $sxe->xpath('//c:title'); foreach ($result as $title) { echo $title . "\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
Warning: SimpleXMLElement::__construct(): Entity: line 2: parser error : Unescaped '<' not allowed in attributes values in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): <media:content medium="media.medium" href="<img src='http://res.cloudinary.com/c in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): ^ in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): Entity: line 2: parser error : attributes construct error in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): <media:content medium="media.medium" href="<img src='http://res.cloudinary.com/c in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): ^ in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): Entity: line 2: parser error : Couldn't find end of Start Tag content line 2 in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): <media:content medium="media.medium" href="<img src='http://res.cloudinary.com/c in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): ^ in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): Entity: line 3: parser error : Unescaped '<' not allowed in attributes values in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): <media:thumbnail medium="media.thumb.medium" href="<img src='http://res.cloudina in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): ^ in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): Entity: line 3: parser error : attributes construct error in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): <media:thumbnail medium="media.thumb.medium" href="<img src='http://res.cloudina in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): ^ in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): Entity: line 3: parser error : Couldn't find end of Start Tag thumbnail line 3 in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): <media:thumbnail medium="media.thumb.medium" href="<img src='http://res.cloudina in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): ^ in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): Entity: line 4: parser error : Opening and ending tag mismatch: rss line 1 and media:content in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): </media:content> in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): ^ in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): Entity: line 5: parser error : Extra content at the end of the document in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): </rss> in /in/mfgGc on line 10 Warning: SimpleXMLElement::__construct(): ^ in /in/mfgGc on line 10 Fatal error: Uncaught Exception: String could not be parsed as XML in /in/mfgGc:10 Stack trace: #0 /in/mfgGc(10): SimpleXMLElement->__construct('<rss xmlns:dc="...') #1 {main} thrown in /in/mfgGc on line 10
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:
54.24 ms | 405 KiB | 8 Q