PHPackages                             doekenorg/iterator-functions - 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. doekenorg/iterator-functions

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

doekenorg/iterator-functions
============================

A package that provides array\_\* like functions for iterators.

v1.0.1(4y ago)675.3k1[1 issues](https://github.com/doekenorg/iterator-functions/issues)[2 PRs](https://github.com/doekenorg/iterator-functions/pulls)MITPHPPHP ^7.4|^8.0

Since Aug 11Pushed 4y ago5 watchersCompare

[ Source](https://github.com/doekenorg/iterator-functions)[ Packagist](https://packagist.org/packages/doekenorg/iterator-functions)[ RSS](/packages/doekenorg-iterator-functions/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (1)Dependencies (2)Versions (5)Used By (0)

Iterator functions
==================

[](#iterator-functions)

[![Latest Version on Packagist](https://camo.githubusercontent.com/39d528fff2a2d3fc45daf439c8897ab8eed2f6a580bf657297382091348b1c06/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646f656b656e6f72672f6974657261746f722d66756e6374696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/doekenorg/iterator-functions)[![Tests](https://github.com/doekenorg/iterator-functions/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/doekenorg/iterator-functions/actions/workflows/run-tests.yml)

The `doekenorg/iterator-functions` package provides a curated set of `array_*` like functions for iterators in PHP. This package is built to encourage developers to make more use of `Iterators` by simplifying common tasks.

Available functions
-------------------

[](#available-functions)

All available functions are modeled after their `array_*` equivalent. But instead of returning an `array` it will return an `Iterator` instance. This means that you can use them in the same way, but get the added memory preserving benefits.

- `iterator_column(\Traversable $iterator, $column_key, $index_key = null): ColumnIterator`
- `iterator_filter(Iterator $iterator, ?callable $callback = null): \CallbackFilterIterator`
- `iterator_flip(Iterator $iterator): FlipIterator`
- `iterator_keys(\Iterator $iterator): KeysIterator`
- `iterator_map(callable $callback, iterable ...$iterators): MapIterator`
- `iterator_reduce(\Iterator $iterator, callable $callback, $initial = null)`
- `iterator_values(\Iterator $iterator): ValuesIterator`
- `iterator_walk(\Iterator $iterator, callable $callback, ...$arguments): void`

*Note:* There are no `_diff` or `_intersect` functions available, because these are not possible without forgoing on the memory benefits of iterators.

Available iterators
-------------------

[](#available-iterators)

Where possible the functions make use of native iterators. Any missing iterators were added to this package.

- `ColumnIterator` - Iterator that returns a single column for the iteration array / object.
- `FlipIterator` - Iterator that flips the key and the value of the current iteration.
- `KeysIterator` - Iterator that returns only the keys of the provided iterator.
- `MapIterator` - Iterator that applies a callback to the elements of the given iterators.
- `ValuesIterator` - Iterator that returns only the values of the provided iterator.

Install
-------

[](#install)

You can install the package via composer:

```
composer require doekenorg/iterator-functions
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
./vendor/bin/pest
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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 ~17 days

Total

2

Last Release

1770d ago

### Community

Maintainers

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

---

Top Contributors

[![doekenorg](https://avatars.githubusercontent.com/u/529515?v=4)](https://github.com/doekenorg "doekenorg (18 commits)")

---

Tags

generatorsiteratorsperformancephp

###  Code Quality

TestsPest

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/doekenorg-iterator-functions/health.svg)

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

###  Alternatives

[event-engine/php-data

Immutable objects for Event Engine

20160.0k5](/packages/event-engine-php-data)

PHPackages © 2026

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