#43392 [Opn->Bgs]: problem with xml comments

From: Date: Wed, 28 Nov 2007 13:41:27 +0000
Subject: #43392 [Opn->Bgs]: problem with xml comments
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-120178@lists.php.net to get a copy of this message
ID: 43392 Updated by: jani@php.net 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

« previous php.bugs (#120178) next »