3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php /** * @link http://stackoverflow.com/a/29864193/367456 */ $buffer = <<<XML <?xml version="1.0"?> <!-- ==================================== xhtml-lat1.ent ==================================== --> <!-- Portions (C) International Organization for Standardization 1986 Permission to copy in any form is granted for use with conforming SGML systems and applications as defined in ISO 8879, provided this notice is included in all copies. --> <!-- Character entity set. Typical invocation: <!ENTITY % HTMLlat1 PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent"> %HTMLlat1; --> <!ENTITY nbsp "&#160;"> <!-- no-break space = non-breaking space, U+00A0 ISOnum --><foo>&nbsp;</foo> XML; libxml_disable_entity_loader(false); $xml = simplexml_load_string($buffer); $xml->asXML('php://output'); $xml = simplexml_load_string($buffer, 'SimpleXMLElement', LIBXML_NOENT); $xml->asXML('php://output');
based on FEbMv
Output for 7.0.0 - 7.2.0
Warning: simplexml_load_string(): Entity: line 22: parser error : StartTag: invalid element name in /in/O4X3F on line 34 Warning: simplexml_load_string(): <!ENTITY nbsp "&#160;"> <!-- no-break space = non-breaking space, in /in/O4X3F on line 34 Warning: simplexml_load_string(): ^ in /in/O4X3F on line 34 Warning: simplexml_load_string(): Entity: line 22: parser error : Extra content at the end of the document in /in/O4X3F on line 34 Warning: simplexml_load_string(): <!ENTITY nbsp "&#160;"> <!-- no-break space = non-breaking space, in /in/O4X3F on line 34 Warning: simplexml_load_string(): ^ in /in/O4X3F on line 34 Fatal error: Uncaught Error: Call to a member function asXML() on boolean in /in/O4X3F:35 Stack trace: #0 {main} thrown in /in/O4X3F on line 35
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Warning: simplexml_load_string(): Entity: line 22: parser error : StartTag: invalid element name in /in/O4X3F on line 34 Warning: simplexml_load_string(): <!ENTITY nbsp "&#160;"> <!-- no-break space = non-breaking space, in /in/O4X3F on line 34 Warning: simplexml_load_string(): ^ in /in/O4X3F on line 34 Warning: simplexml_load_string(): Entity: line 22: parser error : Extra content at the end of the document in /in/O4X3F on line 34 Warning: simplexml_load_string(): <!ENTITY nbsp "&#160;"> <!-- no-break space = non-breaking space, in /in/O4X3F on line 34 Warning: simplexml_load_string(): ^ in /in/O4X3F on line 34 Fatal error: Call to a member function asXML() on boolean in /in/O4X3F on line 35
Process exited with code 255.
Output for 5.3.17 - 5.5.35
Warning: simplexml_load_string(): Entity: line 22: parser error : StartTag: invalid element name in /in/O4X3F on line 34 Warning: simplexml_load_string(): <!ENTITY nbsp "&#160;"> <!-- no-break space = non-breaking space, in /in/O4X3F on line 34 Warning: simplexml_load_string(): ^ in /in/O4X3F on line 34 Warning: simplexml_load_string(): Entity: line 22: parser error : Extra content at the end of the document in /in/O4X3F on line 34 Warning: simplexml_load_string(): <!ENTITY nbsp "&#160;"> <!-- no-break space = non-breaking space, in /in/O4X3F on line 34 Warning: simplexml_load_string(): ^ in /in/O4X3F on line 34 Fatal error: Call to a member function asXML() on a non-object in /in/O4X3F on line 35
Process exited with code 255.