3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<EOD <?xml version="1.0" encoding="UTF-8"?> <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"> <channel> <title> <![CDATA[ Cermati RSS ]]> </title> <description> <![CDATA[ Artikel Finansial terbaru dari Cermati.com ]]> </description> <link>https://www.cermati.com</link> <image> <url>https://www.cermati.com/favicon-32x32.png</url> <title>Cermati RSS</title> <link>https://www.cermati.com</link> </image> <generator>RSS for Node</generator> <lastBuildDate>Mon, 25 Jan 2016 17:46:25 GMT</lastBuildDate> <atom:link href="https://www.cermati.com/rss" rel="self" type="application/rss+xml"/> <author> <![CDATA[ Cermati Content Team ]]> </author> <language> <![CDATA[ id ]]> </language> <ttl>240</ttl> <item> <pubDate>Mon, 25 Jan 2016 05:00:00 GMT</pubDate> <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> </item> </channel> </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 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Warning: SimpleXMLElement::__construct(): Entity: line 28: parser error : Unescaped '<' not allowed in attributes values in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): <media:content medium="media.medium" href="<img src='http://res.cloudinary.com/c in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 28: parser error : attributes construct error in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): <media:content medium="media.medium" href="<img src='http://res.cloudinary.com/c in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 28: parser error : Couldn't find end of Start Tag content line 28 in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): <media:content medium="media.medium" href="<img src='http://res.cloudinary.com/c in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 29: parser error : Unescaped '<' not allowed in attributes values in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): <media:thumbnail medium="media.thumb.medium" href="<img src='http://res.cloudina in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 29: parser error : attributes construct error in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): <media:thumbnail medium="media.thumb.medium" href="<img src='http://res.cloudina in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 29: parser error : Couldn't find end of Start Tag thumbnail line 29 in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): <media:thumbnail medium="media.thumb.medium" href="<img src='http://res.cloudina in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 30: parser error : Opening and ending tag mismatch: item line 26 and media:content in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): </media:content> in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 31: parser error : Opening and ending tag mismatch: channel line 3 and item in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): </item> in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 32: parser error : Opening and ending tag mismatch: rss line 2 and channel in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): </channel> in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 33: parser error : Extra content at the end of the document in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): </rss> in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Fatal error: Uncaught Exception: String could not be parsed as XML in /in/VfMko:38 Stack trace: #0 /in/VfMko(38): SimpleXMLElement->__construct('<?xml version="...') #1 {main} thrown in /in/VfMko on line 38
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Warning: SimpleXMLElement::__construct(): Entity: line 28: parser error : Unescaped '<' not allowed in attributes values in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): <media:content medium="media.medium" href="<img src='http://res.cloudinary.com/c in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 28: parser error : attributes construct error in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): <media:content medium="media.medium" href="<img src='http://res.cloudinary.com/c in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 28: parser error : Couldn't find end of Start Tag content line 28 in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): <media:content medium="media.medium" href="<img src='http://res.cloudinary.com/c in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 29: parser error : Unescaped '<' not allowed in attributes values in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): <media:thumbnail medium="media.thumb.medium" href="<img src='http://res.cloudina in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 29: parser error : attributes construct error in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): <media:thumbnail medium="media.thumb.medium" href="<img src='http://res.cloudina in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 29: parser error : Couldn't find end of Start Tag thumbnail line 29 in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): <media:thumbnail medium="media.thumb.medium" href="<img src='http://res.cloudina in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 30: parser error : Opening and ending tag mismatch: item line 26 and media:content in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): </media:content> in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 31: parser error : Opening and ending tag mismatch: channel line 3 and item in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): </item> in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 32: parser error : Opening and ending tag mismatch: rss line 2 and channel in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): </channel> in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 33: parser error : Extra content at the end of the document in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): </rss> in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Fatal error: Uncaught Exception: String could not be parsed as XML in /in/VfMko:38 Stack trace: #0 /in/VfMko(38): SimpleXMLElement->__construct('<?xml version="...') #1 {main} thrown in /in/VfMko on line 38
Process exited with code 255.
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Warning: SimpleXMLElement::__construct(): Entity: line 28: parser error : Unescaped '<' not allowed in attributes values in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): <media:content medium="media.medium" href="<img src='http://res.cloudinary.com/c in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 28: parser error : attributes construct error in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): <media:content medium="media.medium" href="<img src='http://res.cloudinary.com/c in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 28: parser error : Couldn't find end of Start Tag content line 28 in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): <media:content medium="media.medium" href="<img src='http://res.cloudinary.com/c in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 29: parser error : Unescaped '<' not allowed in attributes values in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): <media:thumbnail medium="media.thumb.medium" href="<img src='http://res.cloudina in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 29: parser error : attributes construct error in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): <media:thumbnail medium="media.thumb.medium" href="<img src='http://res.cloudina in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 29: parser error : Couldn't find end of Start Tag thumbnail line 29 in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): <media:thumbnail medium="media.thumb.medium" href="<img src='http://res.cloudina in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 30: parser error : Opening and ending tag mismatch: item line 26 and media:content in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): </media:content> in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 31: parser error : Opening and ending tag mismatch: channel line 3 and item in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): </item> in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 32: parser error : Opening and ending tag mismatch: rss line 2 and channel in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): </channel> in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): Entity: line 33: parser error : Extra content at the end of the document in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): </rss> in /in/VfMko on line 38 Warning: SimpleXMLElement::__construct(): ^ in /in/VfMko on line 38 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/VfMko:38 Stack trace: #0 /in/VfMko(38): SimpleXMLElement->__construct('<?xml version="...') #1 {main} thrown in /in/VfMko on line 38
Process exited with code 255.

preferences:
160.79 ms | 406 KiB | 183 Q