Bug #75155 [Ver->Csd]: AppendIterator::append() is broken when appending another AppendIterator

From: Date: Mon, 04 Sep 2017 19:28:50 +0000
Subject: Bug #75155 [Ver->Csd]: AppendIterator::append() is broken when appending another AppendIterator
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210945@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75155&edit=1 ID: 75155 Updated by: nikic@php.net Reported by: bschussek at gmail dot com Summary: AppendIterator::append() is broken when appending another AppendIterator -Status: Verified +Status: Closed Type: Bug Package: SPL related Operating System: ubuntu 16.04 LTS PHP Version: 7.1.9 -Assigned To: +Assigned To: nikic Block user comment: N Private report: N New Comment: I've reverted the patch for bug #74977 for now. https://github.com/php/php-src/commit/b689857d53177b6027679f67fecbde8f36c174d1 https://github.com/php/php-src/commit/c2e3541cc1200f38f72deccac66d889888e3949d Previous Comments: ------------------------------------------------------------------------ [2017-09-04 19:27:41] nikic@php.net Related To: Bug #74977 ------------------------------------------------------------------------ [2017-09-04 16:05:13] requinix@php.net New to 7.1.9 https://3v4l.org/egvFW and apparently created during the fix for bug #74977. ------------------------------------------------------------------------ [2017-09-04 15:22:02] bschussek at gmail dot com Description: ------------ When passing another AppendIterator to AppendIterator::append(), the entire AppendIterator is returned during iteration instead of the individual entries. Test script: --------------- <?php $array_a = new ArrayIterator(array('a', 'b', 'c')); $array_b = new ArrayIterator(array('d', 'e', 'f')); $iterator = new AppendIterator; $iterator->append($array_a); $iterator2 = new AppendIterator; $iterator2->append($iterator); $iterator2->append($array_b); foreach ($iterator2 as $current) { echo $current; } Expected result: ---------------- abcdef Actual result: -------------- PHP Catchable fatal error: Object of class ArrayIterator could not be converted to string ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75155&edit=1

« previous php.bugs (#210945) next »