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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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: Fri Dec 27 02:01:29 2024 UTC