php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #60588 MultipleIterator::current return type not documented properly
Submitted: 2011-12-21 18:15 UTC Modified: 2012-12-09 01:21 UTC
From: crmalibu at gmail dot com Assigned: levim (profile)
Status: Closed Package: SPL related
PHP Version: 5.4.0RC3 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: crmalibu at gmail dot com
New email:
PHP Version: OS:

 

 [2011-12-21 18:15 UTC] crmalibu at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/multipleiterator.current#refsect1-multipleiterator.current-returnvalues
---

The return type is said to be an array of Iterators. The return type is an array of the current values of each of the Iterators.



also, method signature is wrong. It says return type is void, but return type is array|false
public void MultipleIterator::current ( void )

Test script:
---------------
<?php
$iter = new MultipleIterator();
$iter->attachIterator(new ArrayIterator(range(5,6)));
$iter->rewind();
var_dump($iter->current());

Expected result:
----------------
something like

array(1) {
  [0]=>
  object(ArrayIterator)#3 (1) {
  ["storage":"ArrayIterator":private]=>
  array(2) {
    [0]=>
    int(5)
    [1]=>
    int(6)
  }
}
}

Actual result:
--------------
array(1) {
  [0]=>
  int(5)
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-04-27 23:18 UTC] salathe@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: salathe
 [2012-11-16 19:03 UTC] levim@php.net
-Assigned To: salathe +Assigned To: levim
 [2012-11-16 19:03 UTC] levim@php.net
This has been partially updated.  I'll confirm that the remainder is true and 
finish this ticket.

Thank you for your report!
 [2012-11-16 19:03 UTC] levim@php.net
This has partially been updated.  I'll review this report soon and finish the 
changes as needed.

Thank you for your report!
 [2012-12-09 01:10 UTC] levim@php.net
Automatic comment from SVN on behalf of levim
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=328714
Log: Updated return information to match its current implementation. See bug report #60588.
 [2012-12-09 01:21 UTC] levim@php.net
-Status: Assigned +Status: Closed
 [2012-12-09 01:21 UTC] levim@php.net
This has been fixed. It may take a week to propagate to the documentation mirrors.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 13:01:29 2024 UTC