#18511 [Opn->Csd]: child_nodes() == 1 when has_child_nodes() == false
| From: | chregu@php.net | Date: | Wed, 14 Aug 2002 07:30:08 +0000 |
| Subject: | #18511 [Opn->Csd]: child_nodes() == 1 when has_child_nodes() == false | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-16738@lists.php.net to get a copy of this message | ||
ID: 18511
Updated by: chregu@php.net
Reported By: gk@proliberty.com
-Status: Open
+Status: Closed
Bug Type: DOM XML related
Operating System: linux 2.4.18 kernel; Red Hat 7.2
PHP Version: 4.2.1
New Comment:
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a
documentation
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2002-07-23 16:00:42] gk@proliberty.com
--- CODE:
<?php
$xmlstr = '<?xml version="1.0"?><root/>';
$doc = domxml_open_mem($xmlstr);
$root = $doc->document_element();
$childNodes = $root->child_nodes();
$count = count( $childNodes );
echo 'has_child_nodes is '; echo $root->has_child_nodes() ? 'true' :
'false';
echo "\nnumber of child nodes = $count\n";
?>
--- RESULT:
has_child_nodes is false
number of child nodes = 1
--- EXPECTED RESULT
has_child_nodes is false
number of child nodes = 0
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18511&edit=1