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($dom->documentElement->saveXML()); echo $xml->asXML();
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to a member function saveXML() on null in /in/vA9T4:5 Stack trace: #0 {main} thrown in /in/vA9T4 on line 5
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function saveXML() on a non-object (null)' in /in/vA9T4:5 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.7 - 5.6.28
Fatal error: Call to a member function saveXML() on null in /in/vA9T4 on line 5
Process exited with code 255.
Output for 5.1.3 - 5.5.35
Fatal error: Call to a member function saveXML() on a non-object in /in/vA9T4 on line 5
Process exited with code 255.
Output for 5.0.0 - 5.1.2
Fatal error: Call to undefined method SimpleXMLElement::addChild() in /in/vA9T4 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/vA9T4 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/vA9T4 on line 2