PHPackages                             baguette/copipe-iter - 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. baguette/copipe-iter

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

baguette/copipe-iter
====================

Most simple iterators

0.0.4(9y ago)0581WTFPLPHPPHP &gt;=5.5.0

Since Aug 10Pushed 4y ago1 watchersCompare

[ Source](https://github.com/BaguettePHP/CopipeIter)[ Packagist](https://packagist.org/packages/baguette/copipe-iter)[ RSS](/packages/baguette-copipe-iter/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (5)Used By (1)

Copipe Iter
===========

[](#copipe-iter)

[![Package version](https://camo.githubusercontent.com/af46894b0d3a4d92836d4b96c9facdc364e956e8bc48a1dbd159d2fda74d9ff6/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62616775657474652f636f706970652d697465722e7376673f7374796c653d666c6174)](https://packagist.org/packages/baguette/copipe-iter)[![Build Status](https://camo.githubusercontent.com/ebd1530e0c6482e1d51d87037ef127cc4e64a09fab2687552672c8400370e0ca/68747470733a2f2f7472617669732d63692e6f72672f42616775657474655048502f436f70697065497465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/BaguettePHP/CopipeIter)[![Packagist](https://camo.githubusercontent.com/6a0a20f95f8aba6e90891953ad146505eff78acb67ae8bfa2ec7214eb167fb6a/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62616775657474652f636f706970652d697465722e7376673f7374796c653d666c6174)](https://packagist.org/packages/baguette/copipe-iter)[![Coverage Status](https://camo.githubusercontent.com/6935c839c162cfa669514bb5d0f43cfb4cce1bf7192cc2de52cbc7f125d15725/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f42616775657474655048502f436f70697065497465722f62616467652e737667)](https://coveralls.io/r/BaguettePHP/CopipeIter)

Most simple iterators.

I do not claim the right for this project. This package is licensed under [WTFPL](http://www.wtfpl.net/).

API
---

[](#api)

### `Generator map(iterable $iter, callable $callback)`

[](#generator-mapiterable-iter-callable-callback)

```
$data = [1, 2, 3];
$twice = function ($n) { return $n * 2; };

foreach (map($data, $twice) as $a) {
    echo $a, PHP_EOL;
}
// [output] 2, 4, 6
```

### `Generator map_kv(iterable $iter, callable $callback)`

[](#generator-map_kviterable-iter-callable-callback)

```
$data = ['apple', 'orange', 'strawberry'];
$deco = function ($k, $v) { return "{$k}: $v"; };

foreach (map_kv($data, $deco) as $a) {
    echo $a, PHP_EOL;
}
// [output] "1: apple", "2: orange", "3: strawberry"
```

### `Generator take(iterable $iter, int $n)`

[](#generator-takeiterable-iter-int-n)

```
$data = range(1, 100);

foreach (take($data, 5) as $a) {
    echo $a, PHP_EOL;
}
// [output] 1, 2, 3, 4, 5
```

### `array to_array(iterable $iter)`

[](#array-to_arrayiterable-iter)

```
$fib = function () {
    $n = 0; yield $n;
    $m = 1; yield $m;

    while (true) {
        $c = $n + $m;
        yield $c;
        $n = $m;
        $m = $c;
    }
};

$fib_10 = to_array(take($fib(), 10));
//=> [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.4% 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 ~87 days

Total

4

Last Release

3348d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e1cc4bc1729b858086681a12494fda6cced8f26db3d0928ae4d81c68ddf8dc06?d=identicon)[zonuexe](/maintainers/zonuexe)

---

Top Contributors

[![zonuexe](https://avatars.githubusercontent.com/u/822086?v=4)](https://github.com/zonuexe "zonuexe (27 commits)")[![mpyw](https://avatars.githubusercontent.com/u/1351893?v=4)](https://github.com/mpyw "mpyw (1 commits)")

---

Tags

iteratorphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/baguette-copipe-iter/health.svg)

```
[![Health](https://phpackages.com/badges/baguette-copipe-iter/health.svg)](https://phpackages.com/packages/baguette-copipe-iter)
```

###  Alternatives

[components/flag-icon-css

A curated collection of all country flags in SVG — plus the CSS for easier integration.

12.2k1.6M23](/packages/components-flag-icon-css)

PHPackages © 2026

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