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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 12:01:30 2024 UTC