3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = new SimpleXMLElement('<sorrow/>'); $xml->addChild(new DOMCdataSection('jfoaiwejf eoaijfc 9e8a 98agh98fhaeh(g8dshg9a8dhsf78afgg>?>><?DS<F?>D')); echo ($xml->asXML());
Output for 5.2.3 - 5.6.28, 7.0.0 - 7.1.0
Warning: SimpleXMLElement::addChild() expects parameter 1 to be string, object given in /in/aUAAl on line 3 <?xml version="1.0"?> <sorrow/>
Output for hhvm-3.12.0
Warning: addChild() expects parameter 1 to be string, object given in /in/aUAAl on line 3 <?xml version="1.0"?> <sorrow/>
Output for hhvm-3.10.0
Catchable fatal error: Object of class DOMCdataSection could not be converted to string in /in/aUAAl on line 3
Process exited with code 255.
Output for 5.1.3 - 5.2.2
<br /> <b>Warning</b>: SimpleXMLElement::addChild() expects parameter 1 to be string, object given in <b>/in/aUAAl</b> on line <b>3</b><br /> <?xml version="1.0"?> <sorrow/>
Output for 5.0.0 - 5.1.2
<br /> <b>Fatal error</b>: Call to undefined method SimpleXMLElement::addChild() in <b>/in/aUAAl</b> on line <b>3</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.4.9
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: simplexmlelement in <b>/in/aUAAl</b> on line <b>2</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: simplexmlelement in <b>/in/aUAAl</b> on line <b>2</b><br />