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

From: Date: Tue, 24 Oct 2017 07:25:25 +0000
Subject: Bug #62212 [Asn->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-212063@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:         kalle@php.net
 Reported by:        cory dot carson at boeing dot com
 Summary:            AppendIterator::append iterates parameter when
                     added, not when iterated over
-Status:             Assigned
+Status:             Open
 Type:               Bug
 Package:            SPL related
 Operating System:   Windows
 PHP Version:        5.4.3
-Assigned To:        colder
+Assigned To:        
 Block user comment: N
 Private report:     N



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 (#212063) next »