PHPackages                             elephox/collection - 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. elephox/collection

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

elephox/collection
==================

Elephox collection library.

v0.7.0(3y ago)225412MITPHPPHP ^8.1 &lt;8.3

Since Nov 21Pushed 3y ago1 watchersCompare

[ Source](https://github.com/elephox-dev/collection)[ Packagist](https://packagist.org/packages/elephox/collection)[ RSS](/packages/elephox-collection/feed)WikiDiscussions develop Synced 1w ago

READMEChangelogDependencies (1)Versions (46)Used By (12)

Elephox Collection Module
=========================

[](#elephox-collection-module)

This library (or rather module) was inspired by [C#s LINQ library](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/linq/).

However, it is not a full-featured LINQ library. It is only a small subset of the functionality since user-land PHP code cannot fully support all the syntactic sugar. For example, the main feature of LINQ, SQL-like syntax directly in source, is not supported since it would require you to compile/transpile your code, which is not in the scope of this library.

The main idea, however, is to provide a way to iterate over a collection of objects in a more natural/handy way like you can do with `IEnumerable`s in C#.

Examples
--------

[](#examples)

```
