php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #65355 Documented return values for DOMNode::hasChildNodes are incorrect
Submitted: 2013-07-29 18:28 UTC Modified: 2013-10-03 06:45 UTC
From: kyle at klowell dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kyle at klowell dot com
New email:
PHP Version: OS:

 

 [2013-07-29 18:28 UTC] kyle at klowell dot com
Description:
------------
---
From manual page: http://www.php.net/domnode.haschildnodes#refsect1-
domnode.haschildnodes-returnvalues
---

Currently the page lists the following:

```
Return Values

Returns TRUE on success or FALSE on failure.
```

This is incorrect, since the method returns TRUE when the node has child 
elements, and FALSE when it does not. FALSE may or may not be returned by an 
error state, but the developer is most likely looking for the empty state.

This should probably be changed to:

```
Return Values

Returns TRUE if the node has children or FALSE if not.
```


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-03 06:45 UTC] krakjoe@php.net
-Status: Open +Status: Not a bug
 [2013-10-03 06:45 UTC] krakjoe@php.net
hasChildNodes poses a question, just like hasNoChildNodes does.

The return values description is perfectly sufficient.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Apr 16 00:01:23 2021 UTC