php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18511 child_nodes() == 1 when has_child_nodes() == false
Submitted: 2002-07-23 16:00 UTC Modified: 2002-08-14 03:30 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: gk at proliberty dot com Assigned:
Status: Closed Package: DOM XML related
PHP Version: 4.2.1 OS: linux 2.4.18 kernel; Red Hat 7.2
Private report: No CVE-ID: None
 [2002-07-23 16:00 UTC] gk at proliberty dot 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-14 03:30 UTC] chregu@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 05:01:29 2024 UTC