3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $xml = new SimpleXMLElement('<root/>'); $xml->addChild('a', 1); $xml->addChild('a', 2); $xml->addChild('b', array('a','b')); print_r($xml);
based on qa0Mh
Output for 5.5.0 - 7.2.0
Warning: SimpleXMLElement::addChild() expects parameter 2 to be string, array given in /in/u3fcu on line 6 SimpleXMLElement Object ( [a] => Array ( [0] => 1 [1] => 2 ) )