3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $test_array = array ( 'bla' => 'blub', 'foo' => 'bar', 'another_array' => array ( 'stack' => 'overflow', ), ); $xml = new SimpleXMLElement('<root/>'); array_walk_recursive($test_array, array ($xml, 'addChild')); print $xml->asXML();
Output for 5.1.3 - 7.1.0
<?xml version="1.0"?> <root><blub>bla</blub><bar>foo</bar><overflow>stack</overflow></root>
Output for 5.0.0 - 5.1.2
Warning: array_walk_recursive(): Unable to call SimpleXMLElement::addChild() - function does not exist in /in/cksfe on line 11 <?xml version="1.0"?> <root/>
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/cksfe on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/cksfe on line 10