php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #53268 ArrayIterator::count() return type "void" when should be "int"
Submitted: 2010-11-08 20:39 UTC Modified: 2010-11-09 01:25 UTC
From: tace at synacor dot com Assigned: frozenfire (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
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: tace at synacor dot com
New email:
PHP Version: OS:

 

 [2010-11-08 20:39 UTC] tace at synacor dot com
Description:
------------
---
From manual page:
http://www.php.net/arrayiterator.count
 and
http://www.php.net/class.arrayiterator
---
These pages define ArrayIterator::count() as:

public void count ( void )

However, this method is from the Countable interface, which defines the return type as "int". Likewise on the http://www.php.net/arrayiterator.count page it lists in the "Returns" section: "The number."

The prototype should be:

public int count ( void )

Note: RecursiveArrayIterator, CachingIterator, and RecursiveCachingIterator have the same prototyping issue.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-09 01:25 UTC] frozenfire@php.net
Automatic comment from SVN on behalf of frozenfire
Revision: http://svn.php.net/viewvc/?view=revision&revision=305212
Log: Fixed return type and clarified return value, as per bug #53268.
 [2010-11-09 01:25 UTC] frozenfire@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: frozenfire
 [2010-11-09 01:25 UTC] frozenfire@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2010-11-09 11:35 UTC] rquadling@php.net
Automatic comment from SVN on behalf of rquadling
Revision: http://svn.php.net/viewvc/?view=revision&revision=305218
Log: count return type is int
Fix bug#53268
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 20:00:02 2026 UTC