PHPackages                             mobileka/mosaic-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. mobileka/mosaic-array

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

mobileka/mosaic-array
=====================

A simple array manipulation class

1.0.0(11y ago)01.2k1MITPHPPHP &gt;=5.4.0

Since Feb 16Pushed 11y agoCompare

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

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

Mosaic Array
============

[](#mosaic-array)

[![Build Status](https://camo.githubusercontent.com/d350b0bdf8b276d97c314200a27d0d2fb9836b867cfad52429b749bebc8b24da/68747470733a2f2f7472617669732d63692e6f72672f6d6f62696c656b612f6d6f736169632d61727261792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mobileka/mosaic-array)[![Coverage Status](https://camo.githubusercontent.com/dc4d9f32ececd2301bbba23225ab9f25bd235a2668a0d10d834baf1902c75048/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6d6f62696c656b612f6d6f736169632d61727261792f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/r/mobileka/mosaic-array?branch=master)[![Code Climate](https://camo.githubusercontent.com/5aec151e499dff3832eaee2aff65463fb404474b1f5484394fac48e3b8881d34/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d6f62696c656b612f6d6f736169632d61727261792f6261646765732f6770612e737667)](https://codeclimate.com/github/mobileka/mosaic-array)

A simple array manipulation class.

Requirements:
-------------

[](#requirements)

PHP &gt;= 5.4.\*

Some examples:
--------------

[](#some-examples)

A very common case when you need to do something like this:

```
if (isset($arr['key']) {
	$result = $arr['key'];
} else {
	$result = 'default';
}

// another way to write the same thing
$result = isset($arr['key']) ? $arr['key'] : 'default';
```

With `MosaicArray` you can do the same thing more elegantly:

```
$result = MosaicArray::make($arr)->getItem('key', 'default');
//or
$ma = new MosaicArray($arr);
$result = $ma->getItem('key', 'default');
```

`MosaicArray` implements `ArrayAccess`, `IteratorAggregate`, `Countable` and `Serializable` interfaces, so you can access an instance of this class as an array, iterate over it, count elements, serialize and unserialize it:

```
$numbers = new MosaicArray([1, 2, 3]);

echo $numbers[0]; //1

foreach ($numbers as $number) {
	// do something
}

echo count($numbers); // 3

serialize($numbers);
unserialize($numbers);
```

License
-------

[](#license)

MosaicArray is open-source and licensed under the [MIT License](https://github.com/mobileka/mosaiq-array/blob/master/license)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

4110d ago

### Community

Maintainers

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

---

Top Contributors

[![mobileka](https://avatars.githubusercontent.com/u/1132388?v=4)](https://github.com/mobileka "mobileka (3 commits)")

---

Tags

helpersarrays

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mobileka-mosaic-array/health.svg)

```
[![Health](https://phpackages.com/badges/mobileka-mosaic-array/health.svg)](https://phpackages.com/packages/mobileka-mosaic-array)
```

###  Alternatives

[danielstjules/stringy

A string manipulation library with multibyte support

2.4k26.0M191](/packages/danielstjules-stringy)[voku/arrayy

Array manipulation library for PHP, called Arrayy!

4875.5M16](/packages/voku-arrayy)[voku/stringy

A string manipulation library with multibyte support

1783.8M19](/packages/voku-stringy)[pragmarx/ia-arr

Laravel Illuminate Agnostic Arr

553.6M12](/packages/pragmarx-ia-arr)[statamic/stringy

A string manipulation library with multibyte support, forked from @statamic

234.5M14](/packages/statamic-stringy)

PHPackages © 2026

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