PHPackages                             wyrihaximus/iterator-or-array-to-array - 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. wyrihaximus/iterator-or-array-to-array

Abandoned → \[...$iteratorOrArray\] instead of thisArchivedLibrary[Utility &amp; Helpers](/categories/utility)

wyrihaximus/iterator-or-array-to-array
======================================

Like iterator\_to\_array but doesn't error when handed an array

1.2.0(4y ago)2241.3k↓33.3%[4 PRs](https://github.com/WyriHaximus/php-iterator-or-array-to-array/pulls)7MITMakefilePHP ^8 || ^7.4

Since Oct 25Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/WyriHaximus/php-iterator-or-array-to-array)[ Packagist](https://packagist.org/packages/wyrihaximus/iterator-or-array-to-array)[ GitHub Sponsors](https://github.com/WyriHaximus)[ RSS](/packages/wyrihaximus-iterator-or-array-to-array/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (9)Used By (7)

Like iterator\_to\_array but doesn't error when handed an array
===============================================================

[](#like-iterator_to_array-but-doesnt-error-when-handed-an-array)

[![Build Status](https://camo.githubusercontent.com/cc069219975921a74ca382ea2e4c2087ba1f511cfe44773eceac792d33a4e10e/68747470733a2f2f7472617669732d63692e636f6d2f57797269486178696d75732f7068702d6974657261746f722d6f722d61727261792d746f2d61727261792e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/WyriHaximus/php-iterator-or-array-to-array)[![Latest Stable Version](https://camo.githubusercontent.com/38a1b94be1be8c0525848537011ad77497e0c626b6324c5ff1cf7c343ce420f5/68747470733a2f2f706f7365722e707567782e6f72672f77797269686178696d75732f6974657261746f722d6f722d61727261792d746f2d61727261792f762f737461626c652e706e67)](https://packagist.org/packages/wyrihaximus/iterator-or-array-to-array)[![Total Downloads](https://camo.githubusercontent.com/0ad7d724471eb16037e6b63075061a9e7d4a3098c4f05f4a6d2845388d395ea4/68747470733a2f2f706f7365722e707567782e6f72672f77797269686178696d75732f6974657261746f722d6f722d61727261792d746f2d61727261792f646f776e6c6f6164732e706e67)](https://packagist.org/packages/wyrihaximus/iterator-or-array-to-array/stats)[![Code Coverage](https://camo.githubusercontent.com/ce79ea18c14b29dc65651bbb403efd0bf4c4626d640d3444befc2175ba622a7b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f57797269486178696d75732f7068702d6974657261746f722d6f722d61727261792d746f2d61727261792f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/WyriHaximus/php-iterator-or-array-to-array/?branch=master)[![License](https://camo.githubusercontent.com/e48159a23770d9503776ba124031031502bb2741e2e927fd9711245433229798/68747470733a2f2f706f7365722e707567782e6f72672f77797269686178696d75732f6974657261746f722d6f722d61727261792d746f2d61727261792f6c6963656e73652e706e67)](https://packagist.org/packages/wyrihaximus/iterator-or-array-to-array)[![PHP 7 ready](https://camo.githubusercontent.com/0c18c1e1bf3ad093b0446f9c6cb313f0d807baca91a3932531a2af38ad90bcca/687474703a2f2f7068703772656164792e74696d6573706c696e7465722e63682f57797269486178696d75732f7068702d6974657261746f722d6f722d61727261792d746f2d61727261792f62616467652e737667)](https://travis-ci.com/WyriHaximus/php-iterator-or-array-to-array)

Install
=======

[](#install)

To install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `^`.

```
composer require wyrihaximus/iterator-or-array-to-array

```

Usage
=====

[](#usage)

```
use function WyriHaximus\iteratorOrArrayToArray;

// Instead of iterator_to_array
$array = iteratorOrArrayToArray($iterable);
```

License
=======

[](#license)

The MIT License (MIT)

Copyright (c) 2018 Cees-Jan Kiewiet

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance43

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

3

Last Release

1716d ago

PHP version history (2 changes)1.0.0PHP ^7.2

1.2.0PHP ^8 || ^7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/147145?v=4)[Cees-Jan Kiewiet](/maintainers/WyriHaximus)[@WyriHaximus](https://github.com/WyriHaximus)

---

Top Contributors

[![WyriHaximus](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/WyriHaximus "WyriHaximus (15 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (13 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (9 commits)")

---

Tags

hacktoberfest

### Embed Badge

![Health badge](/badges/wyrihaximus-iterator-or-array-to-array/health.svg)

```
[![Health](https://phpackages.com/badges/wyrihaximus-iterator-or-array-to-array/health.svg)](https://phpackages.com/packages/wyrihaximus-iterator-or-array-to-array)
```

###  Alternatives

[liderman/php-text-generator

Fast SEO text generator on a mask

277.9k](/packages/liderman-php-text-generator)

PHPackages © 2026

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