Doc #60588 [Opn->Asn]: MultipleIterator::current return type not documented properly
| From: | salathe@php.net | Date: | Fri, 27 Apr 2012 23:18:48 +0000 |
| Subject: | Doc #60588 [Opn->Asn]: MultipleIterator::current return type not documented properly | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-8309@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60588&edit=1
ID: 60588
Updated by: salathe@php.net
Reported by: crmalibu at gmail dot com
Summary: MultipleIterator::current return type not documented
properly
-Status: Open
+Status: Assigned
Type: Documentation Problem
Package: SPL related
PHP Version: 5.4.0RC3
-Assigned To:
+Assigned To: salathe
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2011-12-21 18:15:27] 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)
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60588&edit=1