php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #69701 Example provided for the count function acts on the wrong element
Submitted: 2015-05-24 21:23 UTC Modified: 2015-05-24 21:38 UTC
From: malcolm at notyourhomework dot net Assigned: cmb (profile)
Status: Not a bug Package: SimpleXML related
PHP Version: Irrelevant OS: Mac OS X
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: malcolm at notyourhomework dot net
New email:
PHP Version: OS:

 

 [2015-05-24 21:23 UTC] malcolm at notyourhomework dot net
Description:
------------
---
From manual page: http://www.php.net/simplexmlelement.count
---

The count example script operates on the person element, It should be operating on the child element. 

presently it is 

$person->count()

it should be 

$person->child->count()


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-05-24 21:38 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2015-05-24 21:38 UTC] cmb@php.net
The example is correct; the documentation states:

| This method counts the number of children of an element.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Nov 29 15:05:53 2022 UTC