3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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"; }
based on eLTcf
Output for 7.0.0 - 7.2.0
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.
Output for 5.3.22 - 5.6.28
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 'Exception' with message '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.