ID: 43392 Updated by: [EMAIL PROTECTED] Reported By: 007NOT at gmail dot com -Status: Open +Status: Bogus Bug Type: SimpleXML related Operating System: win xp sp2 PHP Version: 5.2.5 New Comment:
This is just normal and expected behaviour. <foo><!-- comment --></foo> is not same as <foo></foo>. (try var_dump($xml); to see what happens) Previous Comments: ------------------------------------------------------------------------ [2007-11-23 19:16:01] 007NOT at gmail dot com Description: ------------ simpleXml makes counteble xml comments. see code: Reproduce code: --------------- $string = <<<XML <?xml version='1.0'?> <document> <node><!-- comment --></node> <otherNode></otherNode> </document> XML; $xml = simplexml_load_string($string); echo "Node: ". count((array) $xml->node) . "\n"; //expects 0 echo "Other Node: ".count((array) $xml->otherNode) . "\n"; //expects 1 Expected result: ---------------- Node: 0 Other Node: 0 Actual result: -------------- Node: 1 Other Node: 0 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43392&edit=1