PHPackages                             wmsamolet/php-object-collections - 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. wmsamolet/php-object-collections

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

wmsamolet/php-object-collections
================================

PHP object collections - strongly typed collections for objects and more

1.8.0(4y ago)3271MITPHPPHP &gt;=7.2.0

Since Nov 12Pushed 4y ago2 watchersCompare

[ Source](https://github.com/wmsamolet/php-object-collections)[ Packagist](https://packagist.org/packages/wmsamolet/php-object-collections)[ RSS](/packages/wmsamolet-php-object-collections/feed)WikiDiscussions main Synced 6d ago

READMEChangelogDependencies (2)Versions (20)Used By (1)

PHP Object Collections
======================

[](#php-object-collections)

[![Latest Stable Version](https://camo.githubusercontent.com/4b89275f6767b4516d75d4479443158c933113769db0e1b9b5c13614b1abc201/687474703a2f2f706f7365722e707567782e6f72672f776d73616d6f6c65742f7068702d6f626a6563742d636f6c6c656374696f6e732f76)](https://packagist.org/packages/wmsamolet/php-object-collections)[![Total Downloads](https://camo.githubusercontent.com/6641338b9c7ba0d58986b8fbcdd35198587e19e82e94e4cb45d53c812f0290ea/687474703a2f2f706f7365722e707567782e6f72672f776d73616d6f6c65742f7068702d6f626a6563742d636f6c6c656374696f6e732f646f776e6c6f616473)](https://packagist.org/packages/wmsamolet/php-object-collections)[![Latest Unstable Version](https://camo.githubusercontent.com/3f9f582f0e8fe2cec5446dd276c8b2d6b53741adf93fec9e993a80b180e291c9/687474703a2f2f706f7365722e707567782e6f72672f776d73616d6f6c65742f7068702d6f626a6563742d636f6c6c656374696f6e732f762f756e737461626c65)](https://packagist.org/packages/wmsamolet/php-object-collections)[![License](https://camo.githubusercontent.com/c3ff579b1047b57a02115460271d262b606ba4cc5a3c36105e35ff55a002e9ef/687474703a2f2f706f7365722e707567782e6f72672f776d73616d6f6c65742f7068702d6f626a6563742d636f6c6c656374696f6e732f6c6963656e7365)](https://packagist.org/packages/wmsamolet/php-object-collections)[![PHP Version Require](https://camo.githubusercontent.com/64df4b09900e74ee717b5813e25b61793b44a67c9bafe88d214349b2536e6a71/687474703a2f2f706f7365722e707567782e6f72672f776d73616d6f6c65742f7068702d6f626a6563742d636f6c6c656374696f6e732f726571756972652f706870)](https://packagist.org/packages/wmsamolet/php-object-collections)[![PHP Version Require](https://camo.githubusercontent.com/8ed94a14818d30a12bd25153b945c78eeda9a6c0a13152457164bccbf244a154/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f64696e672532305374796c652d5053522d2d31322d253233323536643465)](https://www.php-fig.org/psr/psr-12/)

Strongly typed collections for objects and more

### Advantages:

[](#advantages)

- Storage in collections of **strictly** specified objects
- Ability to specify **ANY [Traversable](https://www.php.net/manual/en/class.traversable.php) object**as data (useful for storing ORM Iterators, for example )
- Ability to work with a collection **as an array**
- Possibility of pagination (in batches) using **-&gt;batch(...)**, **-&gt;slice(...)**, **-&gt;page(...)**

Documentation
-------------

[](#documentation)

- [Usage object static collection](docs/usage-object-static.md)
- [Usage typed static collection](docs/usage-typed-static.md)
- [Testing](docs/testing.md)
- [Contributing](docs/contributing.md)
- [Changelog](docs/changelog.md)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require wmsamolet/php-collections

```

or add

```
"wmsamolet/php-collections": "^1.0"

```

to the requirement section of your `composer.json` file.

Basic usage **object** collections
----------------------------------

[](#basic-usage-object-collections)

```
