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: 2018-02-11 13:28 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: jhdxr (profile)
Status: Closed Package: SPL related
PHP Version: 5.2.9 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: for-bugs at hnw dot jp
New email:
PHP Version: OS:

 

 [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:
 [2018-02-11 13:27 UTC] jhdxr@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: jhdxr
 [2018-02-11 13:27 UTC] jhdxr@php.net
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php


 [2018-02-11 13:28 UTC] jhdxr@php.net
same cause of bug #73471
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Oct 21 08:01:24 2018 UTC