PHPackages                             salarmehr/ary - 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. salarmehr/ary

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

salarmehr/ary
=============

A php array/stdClass alternative to store configs, options and more.

1.0.0(7y ago)85.0k3[1 PRs](https://github.com/salarmehr/ary/pulls)MITPHPPHP &gt;=5.4.0

Since Oct 1Pushed 2y ago1 watchersCompare

[ Source](https://github.com/salarmehr/ary)[ Packagist](https://packagist.org/packages/salarmehr/ary)[ RSS](/packages/salarmehr-ary/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (16)Used By (0)

Ary
===

[](#ary)

Ary provides unified interface for ary/object. Really handy to store:

- arrays/objects those their items/properties varies conditionally.
- storing registry, system configuration, env variables, etc.
- when you perform a chain of action on an array/object

It's super cool and after a while you can not code in php without it.

Features
--------

[](#features)

1. You can access array items using `->` or `['']` syntax.
2. You will get `null` if an index does not exists (instead of a nasty notification!)
3. You can specify a default value for missing indexes.
4. You can set/get a value within a deeply nested array using "dot" notation.
5. A bunch of really handy methods: `merge`, `only`, `search`, `toObject`, ...
6. Now, `Ary` extends `Illuminate\Support\Collection` class so all of its methods are available ()

Examples
--------

[](#examples)

```
// Instantiation
$ary = new Ary();
// or simply
$ary = ary();

//Initialization
$ary = ary(2, 4, 6, 8); // or
$ary = ary([2, 4, 6, 8]);
$ary = ary(['x' => 'foo', 'y' => 'bar']);

//Assignment
$ary->newItem=20; //or
$ary['newItem']=20;

//Retrieval
$foo = $ary->x; //or
$foo = $ary['x'];
$missed = $ary->get('missed', 'Default value');
$ary->all(); // returns the simple php array;

// works as regular arrays
count($ary); //returns 3
unset($ary[0]);
json_encode($ary);

// deep assignment/retrieval
$ary = ary(['products' => ['desk' => ['price' => 100]]]);
$value = $ary['products.desk.price']; //100
$ary['production.table.weight']=200;

```

Installation
============

[](#installation)

Simply `include '__DIR__.'/src/helper.php';`

or use Composer:

```
composer require salarmehr/ary

```

- The `Ary()` requires PHP 5.4 or above.
- The `ary()` helper function requires PHP 5.6 or above.

Licence
=======

[](#licence)

MIT

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

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

Recently: every ~252 days

Total

14

Last Release

2703d ago

Major Versions

v0.11 → 1.0.02018-12-24

### Community

Maintainers

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

---

Top Contributors

[![salarmehr](https://avatars.githubusercontent.com/u/2582036?v=4)](https://github.com/salarmehr "salarmehr (51 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/salarmehr-ary/health.svg)

```
[![Health](https://phpackages.com/badges/salarmehr-ary/health.svg)](https://phpackages.com/packages/salarmehr-ary)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9346.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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