3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array( 'id' => 1, 'name' => 'Jacopo', 'male' => true, 'birthday' => new DateTime('1988-07-26'), 'hobbies' => array( 'Programming', 'TV Shows', 'Skiing' ) ); $xml = new SimpleXMLElement('<root/>'); array_walk_recursive($a, array ($xml, 'addChild')); print $xml->asXML();

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
Warning: SimpleXMLElement::addChild() expects parameter 1 to be string, object given in /in/KgWjt on line 15 <?xml version="1.0"?> <root><1>id</1><Jacopo>name</Jacopo><1>male</1><Programming>0</Programming><TV Shows>1</TV Shows><Skiing>2</Skiing></root>
Output for Array change keys
Warning: SimpleXMLElement::addChild() expects parameter 1 to be string, object given in /in/KgWjt on line 15 <?xml version="1.0"?> <root><1>id</1><Jacopo>name</Jacopo><1>male</1><Programming>0</Programming><TV Shows>1</TV Shows><Skiing>2</Skiing></root>
Output for Lexical anon
Warning: SimpleXMLElement::addChild() expects parameter 1 to be string, object given in /in/KgWjt on line 15 <?xml version="1.0"?> <root><1>id</1><Jacopo>name</Jacopo><1>male</1><Programming>0</Programming><TV Shows>1</TV Shows><Skiing>2</Skiing></root>

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page