|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48375 AppendIterator::append() never ends, which has SplFileObject as inner iterator
Submitted: 2009-05-24 16:19 UTC Modified: 2018-02-11 13:28 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: for-bugs at hnw dot jp Assigned: jhdxr (profile)
Status: Closed Package: SPL related
PHP Version: 5.2.9 OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: for-bugs at hnw dot jp
New email:
PHP Version: OS:


 [2009-05-24 16:19 UTC] for-bugs at hnw dot jp
The second AppendIterator::append() call goes endless loop when its first iterator is SplFileObject whose file has only 1 line.

Reproduce code:

$ap = new AppendIterator();
$it = new SplFileObject('data://text/plain;base64,MA==', 'r'); // "0"
$ap->append(new ArrayIterator(array(1))); // endless

foreach ($ap as $value) {

Expected result:
string(1) "0"

Actual result:
run endless.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-24 07:26 UTC]
-Status: Assigned +Status: Open -Assigned To: colder +Assigned To:
 [2018-02-11 13:27 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: jhdxr
 [2018-02-11 13:27 UTC]
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at

 [2018-02-11 13:28 UTC]
same cause of bug #73471
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Mar 30 05:05:48 2023 UTC