php.net |  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: 2017-10-24 07:26 UTC
Votes:1
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:
Status: Open Package: SPL related
PHP Version: 5.2.9 OS: *
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

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

Reproduce code:
---------------
<?php

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

foreach ($ap as $value) {
  var_dump($value);
};

Expected result:
----------------
string(1) "0"
int(1)

Actual result:
--------------
run endless.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-24 07:26 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: colder +Assigned To:
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC