PHPackages                             ali-eltaweel/array-subscript - 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. ali-eltaweel/array-subscript

ActiveLibrary

ali-eltaweel/array-subscript
============================

A PHP library for accessing object properties using array subscript notation.

1.0.0(10mo ago)01301PHPPHP ^8.1

Since Jun 24Pushed 10mo agoCompare

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

READMEChangelog (1)Dependencies (1)Versions (2)Used By (1)

Array-Subscript
===============

[](#array-subscript)

**A PHP library for accessing object properties using array subscript notation.**

- [Array-Subscript](#array-subscript)
    - [Installation](#installation)
    - [Usage](#usage)

---

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

[](#installation)

Install *array-subscript* via Composer:

```
composer require ali-eltaweel/array-subscript
```

Usage
-----

[](#usage)

```
use ArraySubscript\ArrayObject;
use ArraySubscript\Annotations\ArraySubscript;
use ArraySubscript\Annotations\ArraySubscriptOperation;

class X implements ArrayAccess {

  use ArrayObject;

  private array $data = [

    'a' => 1,
    'b' => 2,
    'c' => 3,
    'd' => 4,
  ];

  #[ArraySubscript(ArraySubscriptOperation::Get)]
  function get(string $name): mixed {

    return $this->data[$name];
  }

  #[ArraySubscript(ArraySubscriptOperation::Set)]
  function set(string $name, mixed $value): void {

    $this->data[$name] = $value;
  }

  #[ArraySubscript(ArraySubscriptOperation::Unset)]
  function unset(string $name): void {

    unset($this->data[$name]);
  }

  #[ArraySubscript(ArraySubscriptOperation::Check)]
  function check(string $name): bool {

    return isset($this->data[$name]);
  }
}
```

```
$x = new X();

$a = $x['a'];

$x['b'] = 10;

if (isset($x['c'])) {

  unset($x['d']);
}
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance53

Moderate activity, may be stable

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

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

328d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7564e10ba11b25d8700726a92f669e38be2ff9191e8f6ccdfafc36678ffab2b8?d=identicon)[ali-eltaweel](/maintainers/ali-eltaweel)

---

Top Contributors

[![ali-eltaweel](https://avatars.githubusercontent.com/u/45892756?v=4)](https://github.com/ali-eltaweel "ali-eltaweel (2 commits)")

### Embed Badge

![Health badge](/badges/ali-eltaweel-array-subscript/health.svg)

```
[![Health](https://phpackages.com/badges/ali-eltaweel-array-subscript/health.svg)](https://phpackages.com/packages/ali-eltaweel-array-subscript)
```

PHPackages © 2026

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