php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62212 AppendIterator::append iterates parameter when added, not when iterated over
Submitted: 2012-06-02 05:27 UTC Modified: 2021-08-11 10:20 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: cory dot carson at boeing dot com Assigned:
Status: Open Package: SPL related
PHP Version: 5.4.3 OS: Windows
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 — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
38 + 24 = ?
Subscribe to this entry?

 
 [2012-06-02 05:27 UTC] cory dot carson at boeing dot com
Description:
------------
AppendIterator will iterate over iterators that you append to it during the call to append(). Expected behavior is to only iterate over attached iterators when the outer AppendIterator is iterated over.

Possibly related to https://bugs.php.net/bug.php?id=49104

Test script:
---------------
(new \AppendIterator())->append(
	new \CallbackFilterIterator(
		new \ArrayIterator([1]), 
		static function(){ echo "Iterated over"; }
	)
);

Expected result:
----------------
No output

Actual result:
--------------
"Iterated over"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-03 13:31 UTC] felipe@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: colder
 [2017-10-24 07:25 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: colder +Assigned To:
 [2021-08-11 10:20 UTC] cmb@php.net
For reference: <https://3v4l.org/dc9eq>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 08:01:28 2024 UTC