PHPackages                             pader/weak-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. pader/weak-array

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

pader/weak-array
================

Array weak reference with value.

1.0.1(3y ago)011MITPHPPHP &gt;=8.0.0

Since Jan 7Pushed 3y ago1 watchersCompare

[ Source](https://github.com/xpader/weak-array)[ Packagist](https://packagist.org/packages/pader/weak-array)[ RSS](/packages/pader-weak-array/feed)WikiDiscussions main Synced today

READMEChangelog (2)DependenciesVersions (3)Used By (0)

PHP Weak Reference Array.
=========================

[](#php-weak-reference-array)

An ArrayAccess implement let you can storage a weak reference object in array by any key type.

This like an temporary cache, help you to reuse same object when it's still use in other place, and will auto unset the item when all reference is destruct.

Install
-------

[](#install)

Require php version &gt;= 8.0.0

```
composer require pader/weak-array
```

Simple example:
---------------

[](#simple-example)

```
$hello = new stdClass;
$hello->value = 'hello';
$world = new stdClass;
$world->value = 'world';

$arr = new WeakArray();
$arr[] = $hello;
$arr['foo'] = $world;

var_dump($arr[0]);
var_dump($arr['foo']);

unset($hello);

var_dump($arr[0]); //Should be null
var_dump($arr['foo']);
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Every ~3 days

Total

2

Last Release

1269d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7917840032121e7f70f6d673d5481a7f2c37f2abcf81020ceac17394af44fc13?d=identicon)[pader](/maintainers/pader)

---

Top Contributors

[![xpader](https://avatars.githubusercontent.com/u/8629617?v=4)](https://github.com/xpader "xpader (5 commits)")

### Embed Badge

![Health badge](/badges/pader-weak-array/health.svg)

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

###  Alternatives

[backpack/basset

Dead-simple way to load CSS or JS assets only once per page, when using Laravel 10+.

206971.5k11](/packages/backpack-basset)[spryker/decimal-object

PHP decimal handling as value object

233.0M64](/packages/spryker-decimal-object)

PHPackages © 2026

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