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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
29 - 19 = ?
Subscribe to this entry?

 
 [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 Apr 19 14:01:30 2024 UTC