Bug #62212 [Opn]: AppendIterator::append iterates parameter when added, not when iterated over

From: Date: Wed, 11 Aug 2021 10:20:05 +0000
Subject: Bug #62212 [Opn]: AppendIterator::append iterates parameter when added, not when iterated over
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235756@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62212&edit=1

 ID:                 62212
 Updated by:         cmb@php.net
 Reported by:        cory dot carson at boeing dot com
 Summary:            AppendIterator::append iterates parameter when
                     added, not when iterated over
 Status:             Open
 Type:               Bug
 Package:            SPL related
 Operating System:   Windows
 PHP Version:        5.4.3
 Block user comment: N
 Private report:     N

 New Comment:

For reference: <https://3v4l.org/dc9eq>


Previous Comments:
------------------------------------------------------------------------
[2012-06-02 05:27:28] 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"


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=62212&edit=1


Thread (4 messages)

« previous php.bugs (#235756) next »