PHPackages                             hikaeme/stdin-iterator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hikaeme/stdin-iterator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hikaeme/stdin-iterator
======================

Iterator to read STDIN line by line

2.0.1(3w ago)2190MITPHPPHP ^8.2

Since Jun 2Pushed 3w ago1 watchersCompare

[ Source](https://github.com/fjyuu/php-stdin-iterator)[ Packagist](https://packagist.org/packages/hikaeme/stdin-iterator)[ RSS](/packages/hikaeme-stdin-iterator/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

Stdin Iterator
==============

[](#stdin-iterator)

Usage
-----

[](#usage)

```
use Hikaeme\StdinIterator;

$stdin = new StdinIterator();

foreach ($stdin as $line) {
    echo $line;
}
```

Installation
------------

[](#installation)

```
composer require hikaeme/stdin-iterator

```

Testable STDIN
--------------

[](#testable-stdin)

```
class SampleCommand
{
    private $stdin;

    public function __construct(StdinIterator $stdin = null)
    {
        $this->stdin = $stdin ?: new StdinIterator();
    }

    public function run()
    {
        foreach ($this->stdin as $line) {
            echo $line;
        }
    }
}
```

```
class SampleCommandTest extends \PHPUnit_Framework_TestCase
{
    public function test()
    {
        $stub = new StdinIteratorStub();
        $stub->setStdin("1\n2\n3\n");

        $command = new \SampleCommand($stub);
        ob_start();
        $command->run();
        $result = ob_get_clean();

        $this->assertSame("1\n2\n3\n", $result);
    }
}
```

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance95

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1081 days

Total

4

Last Release

25d ago

Major Versions

1.1.0 → 2.0.02026-02-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c519ca22dbbc34ffbee1e2ccc490cbb3fa59536e5ebe41845f34595d6b69814?d=identicon)[fjyuu](/maintainers/fjyuu)

---

Top Contributors

[![fjyuu](https://avatars.githubusercontent.com/u/649167?v=4)](https://github.com/fjyuu "fjyuu (7 commits)")

---

Tags

iteratorphpstdin

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hikaeme-stdin-iterator/health.svg)

```
[![Health](https://phpackages.com/badges/hikaeme-stdin-iterator/health.svg)](https://phpackages.com/packages/hikaeme-stdin-iterator)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
