3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = new SimpleXMLElement('<sorrow/>'); $dom = new DOMDocument('1.0', 'utf-8'); $dom->appendChild(new DOMCdataSection('jfoaiwejf eoaijfc 9e8a 98agh98fhaeh(g8dshg9a8dhsf78afgg>?>><?DS<F?>D')); $xml->addChild('sucks', $dom->saveXML($dom->firstChild)); echo $xml->asXML();
Output for 5.1.3 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<?xml version="1.0"?> <sorrow><sucks>&lt;![CDATA[jfoaiwejf eoaijfc 9e8a 98agh98fhaeh(g8dshg9a8dhsf78afgg&gt;?&gt;&gt;&lt;?DS&lt;F?&gt;D]]&gt;</sucks></sorrow>
Output for 5.0.0 - 5.1.2
Fatal error: Call to undefined method SimpleXMLElement::addChild() in /in/hpjdU on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/hpjdU on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/hpjdU on line 2