3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $input = '<document><content><![CDATA[Hello, world!]]></content></document>'; $xml = new SimpleXMLElement($input, LIBXML_NOCDATA); print_r($xml);
based on ksTNc
Output for 5.1.2 - 7.2.0
SimpleXMLElement Object ( [content] => Hello, world! )
Output for 5.1.0 - 5.1.1
Fatal error: Uncaught exception 'Exception' with message 'SimpleXMLElement::__construct() expects exactly 1 parameter, 2 given' in /in/Jh0Dp:4 Stack trace: #0 /in/Jh0Dp(4): SimpleXMLElement->__construct('<document><cont...', 16384) #1 {main} thrown in /in/Jh0Dp on line 4
Process exited with code 255.
Output for 5.0.3 - 5.0.5
Notice: Use of undefined constant LIBXML_NOCDATA - assumed 'LIBXML_NOCDATA' in /in/Jh0Dp on line 4 Fatal error: Uncaught exception 'Exception' with message 'SimpleXMLElement::__construct() expects exactly 1 parameter, 2 given' in /in/Jh0Dp:4 Stack trace: #0 /in/Jh0Dp(4): SimpleXMLElement->__construct('<document><cont...', 'LIBXML_NOCDATA') #1 {main} thrown in /in/Jh0Dp on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.2
Notice: Use of undefined constant LIBXML_NOCDATA - assumed 'LIBXML_NOCDATA' in /in/Jh0Dp on line 4 Fatal error: Uncaught exception 'Exception' with message 'SimpleXMLElement::__construct() expects exactly 1 parameter, 2 given' in /in/Jh0Dp:4 Stack trace: #0 {main} thrown in /in/Jh0Dp on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/Jh0Dp on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/Jh0Dp on line 4