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

From: Date: Mon, 04 Sep 2017 16:05:14 +0000
Subject: Bug #75155 [Opn->Ver]: AppendIterator::append() is broken when appending another AppendIterator
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210934@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: requinix@php.net Reported by: bschussek at gmail dot com Summary: AppendIterator::append() is broken when appending another AppendIterator -Status: Open +Status: Verified Type: Bug Package: SPL related Operating System: ubuntu 16.04 LTS PHP Version: 7.1.9 Block user comment: N Private report: N New Comment: New to 7.1.9 https://3v4l.org/egvFW and apparently created during the fix for bug #74977. Previous Comments: ------------------------------------------------------------------------ [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 (#210934) next »