3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE strony [ <!ENTITY shp SYSTEM "php://echo dir(\"/etc\");"> ] > <strony> <strona id="cccc"> <nazwa>bbbb</nazwa> <url>http://www.aaaa.pl/</url> <komentarz> &shp;</komentarz> </strona> </strony>'; $strony = new SimpleXMLElement($xml, LIBXML_NOENT); foreach($strony->strona->komentarz as $komentarz) echo "$komentarz\n";
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 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.7
Warning: SimpleXMLElement::__construct(): Entity: line 3: parser error : Invalid URI: php://echo dir(\ in /in/gaFiQ on line 14 Warning: SimpleXMLElement::__construct(): <!ENTITY shp SYSTEM "php://echo dir(\"/etc\");"> in /in/gaFiQ on line 14 Warning: SimpleXMLElement::__construct(): ^ in /in/gaFiQ on line 14 Warning: SimpleXMLElement::__construct(): Entity: line 3: parser error : Space required before 'NDATA' in /in/gaFiQ on line 14 Warning: SimpleXMLElement::__construct(): <!ENTITY shp SYSTEM "php://echo dir(\"/etc\");"> in /in/gaFiQ on line 14 Warning: SimpleXMLElement::__construct(): ^ in /in/gaFiQ on line 14 Warning: SimpleXMLElement::__construct(): Entity: line 3: parser error : xmlParseEntityDecl: entity shp not terminated in /in/gaFiQ on line 14 Warning: SimpleXMLElement::__construct(): <!ENTITY shp SYSTEM "php://echo dir(\"/etc\");"> in /in/gaFiQ on line 14 Warning: SimpleXMLElement::__construct(): ^ in /in/gaFiQ on line 14 Fatal error: Uncaught Exception: String could not be parsed as XML in /in/gaFiQ:14 Stack trace: #0 /in/gaFiQ(14): SimpleXMLElement->__construct('<?xml version="...', 2) #1 {main} thrown in /in/gaFiQ on line 14
Process exited with code 255.

preferences:
179.3 ms | 405 KiB | 204 Q