PHPackages                             wernerdweight/ra - 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. wernerdweight/ra

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

wernerdweight/ra
================

PHP Array object with consistent and predictable API

2.0.2(3y ago)19.1k1[1 issues](https://github.com/wernerdweight/RA/issues)[1 PRs](https://github.com/wernerdweight/RA/pulls)8MITPHPPHP &gt;=8.1

Since Mar 17Pushed 1y ago1 watchersCompare

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

READMEChangelog (10)Dependencies (3)Versions (19)Used By (8)

RA
==

[](#ra)

PHP Array object with consistent, predictable and convenient API

[![Build Status](https://camo.githubusercontent.com/dd18b9cc9644356abba3ffcab3732f481b627cf27adbc5151bd9ace1d8f701d9/68747470733a2f2f6170702e7472617669732d63692e636f6d2f7765726e6572647765696768742f52412e7376673f6272616e63683d6d6173746572)](https://app.travis-ci.com/wernerdweight/RA)[![Latest Stable Version](https://camo.githubusercontent.com/fc475d7031892f330fbb09c323225e8f31d13317a4c9b62f28a1fdbe0dc4a35e/68747470733a2f2f706f7365722e707567782e6f72672f7765726e6572647765696768742f72612f762f737461626c65)](https://packagist.org/packages/wernerdweight/ra)[![Total Downloads](https://camo.githubusercontent.com/f3e40989bd53435305a22a9de5837d7a1991d0759b9d2a3abf6fee041b2fd0c6/68747470733a2f2f706f7365722e707567782e6f72672f7765726e6572647765696768742f72612f646f776e6c6f616473)](https://packagist.org/packages/wernerdweight/ra)[![License](https://camo.githubusercontent.com/b5b855d083df3f9d027bf93bdc65ba6a54e34f1eb67ac8d40416f75773cc0a5c/68747470733a2f2f706f7365722e707567782e6f72672f7765726e6572647765696768742f72612f6c6963656e7365)](https://packagist.org/packages/wernerdweight/ra)

Instalation
-----------

[](#instalation)

1. Download using composer

```
composer require wernerdweight/ra
```

2. Use in your project

```
use WernerDweight\RA\RA;

// helper methods (extracted here to simplify the code below and emphasize the difference)

function filterFunction(string $god): bool {
    return false !== strpos($god, 's');
}

function mapFunction(string $godContainingTheLetterS): string {
    return strtoupper($godContainingTheLetterS);
}

function reduceFunction(string $carry, string $god): string {
    return $carry .= ($carry[-1] === ' ' ? '' : ', ') . $god;
}

// create new RA
$egyptianGods = new RA(['Ra', 'Osiris', 'Anubis', 'Horus']);

// use as object
$godsContainingTheLetterSInUppercase = $egyptianGods
    ->filter('filterFunction')
    ->map('mapFunction')
    ->reverse()
    ->reduce('reduceFunction', 'My favourite Egyptian Gods are ');

echo $godsContainingTheLetterSInUppercase . "\n";

// use as normal array
$godsContainingTheLetterSInUppercase = array_reduce(
    array_reverse(
        array_map(
            'mapFunction',
            array_filter(
                $egyptianGods->toArray(),
                'filterFunction'
            )
        )
    ),
    'reduceFunction',
    'My favourite Egyptian Gods are '
);

echo $godsContainingTheLetterSInUppercase . "\n";

// RA extends Iterator, ArrayAccess and Countable
foreach ($egyptianGods as $god) {
    echo sprintf("My favourite Egyptian God is %s\n", $god);
}
```

API
---

[](#api)

TODO:

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 91.3% 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 ~112 days

Recently: every ~292 days

Total

17

Last Release

1182d ago

Major Versions

v0.3.3 → 1.0.02019-06-17

1.2.0 → 2.0.02022-11-08

PHP version history (4 changes)v0.0.1PHP &gt;=7.1.0

v0.3.1PHP &gt;=7.2.0

2.0.0PHP ^8.1

2.0.1PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b1454d4a92d76c33018ef518335ec921cf3eadbe591437c47622510f465c9ed?d=identicon)[wernerdweight](/maintainers/wernerdweight)

---

Top Contributors

[![wernerdweight](https://avatars.githubusercontent.com/u/2445436?v=4)](https://github.com/wernerdweight "wernerdweight (21 commits)")[![alim-shapiev](https://avatars.githubusercontent.com/u/42810034?v=4)](https://github.com/alim-shapiev "alim-shapiev (1 commits)")[![jannovotny-intergram](https://avatars.githubusercontent.com/u/31851222?v=4)](https://github.com/jannovotny-intergram "jannovotny-intergram (1 commits)")

---

Tags

arrayobjectiterable

### Embed Badge

![Health badge](/badges/wernerdweight-ra/health.svg)

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

###  Alternatives

[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k295.3M2.5k](/packages/symfony-property-access)[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k9.2M108](/packages/cuyz-valinor)[jasny/dotkey

Dot notation access for objects and arrays

14219.5k6](/packages/jasny-dotkey)[michaldudek/foundation

A set of useful PHP classes.

13111.9k13](/packages/michaldudek-foundation)[peridot-php/object-path

A string syntax to fetch values from array and object hierarchies

1053.6k1](/packages/peridot-php-object-path)[rotexsoft/versatile-collections

A collection package that can be extended to implement things such as a Dependency Injection Container, RecordSet objects for housing database records, a bag of http cookies, or technically any collection of items that can be looped over and whose items can each be accessed using array-access syntax or object property syntax.

186.0k1](/packages/rotexsoft-versatile-collections)

PHPackages © 2026

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