3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $xml_header = "<?xml version='1.0' encoding='utf-8'?><xml/>"; $xml = new SimpleXMLElement($xml_header); $xml->addChild("test","a > b"); echo $xml->asXml();
Output for 5.1.3 - 7.2.0
<?xml version="1.0" encoding="utf-8"?> <xml><test>a &gt; b</test></xml>
Output for 5.0.0 - 5.1.2
<br /> <b>Fatal error</b>: Call to undefined method SimpleXMLElement::addChild() in <b>/in/IKLD1</b> on line <b>5</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/IKLD1</b> on line <b>4</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/IKLD1</b> on line <b>4</b><br />