3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $xml = '<root><case1><name> </name></case1><case2><name></name></case2><case3><name>ukits</name></case3></root>'; libxml_use_internal_errors(true); $content = simplexml_load_string($xml); if ($content === false) { libxml_clear_errors(); } print_r($content);
based on SvI3B
Output for 5.5.27 - 5.5.38, 5.6.11 - 7.3.0rc4
SimpleXMLElement Object ( [case1] => SimpleXMLElement Object ( [name] => SimpleXMLElement Object ( [0] => ) ) [case2] => SimpleXMLElement Object ( [name] => SimpleXMLElement Object ( ) ) [case3] => SimpleXMLElement Object ( [name] => ukits ) )
Output for 5.5.0 - 5.5.26, 5.6.0 - 5.6.10
SimpleXMLElement Object ( [case1] => SimpleXMLElement Object ( [name] => SimpleXMLElement Object ( [0] => ) ) [case2] => SimpleXMLElement Object ( [0] => SimpleXMLElement Object ( ) ) [case3] => SimpleXMLElement Object ( [name] => ukits ) )