PHPackages                             dmitry-kirillov/simplepack - 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. dmitry-kirillov/simplepack

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

dmitry-kirillov/simplepack
==========================

0.0.2(2y ago)17MITPHPPHP &gt;=5.4

Since Apr 26Pushed 2y ago1 watchersCompare

[ Source](https://github.com/DmitryKirillov/simplepack)[ Packagist](https://packagist.org/packages/dmitry-kirillov/simplepack)[ RSS](/packages/dmitry-kirillov-simplepack/feed)WikiDiscussions main Synced yesterday

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

Simplepack
==========

[](#simplepack)

This is an experimental PHP library that helps reduce the memory footprint when creating and using small-sized associative arrays in large quantities.

Important note: This library is not production-ready yet!

General information
-------------------

[](#general-information)

This library was inspired by various algorithms used in databases and other languages (e.g. Redis). The idea is to convert small hash tables to linear data structures and store them inside a single string. This approach results in reduced memory consumption, not to mention cache locality. Obviously, the time complexity increases to O(n), but given the small size of the dataset the practical difference is vanishingly small.

### Advantages

[](#advantages)

- Plain PHP code
- Supports PHP 5.4 and later
- Consumes ~4 times less memory than associative arrays
- Consumes ~2 times less memory than objects (DTOs)

### Disadvantages

[](#disadvantages)

- Works substantially slower than arrays and objects
- Cannot be used instead of arrays in all scenarios (see examples below)

### Use cases

[](#use-cases)

- A lot of 1-dimensional arrays with dynamic string keys and rather small values
- A lot of foreach loops over these arrays
- Minimum update/delete operations

Requirements
------------

[](#requirements)

- PHP 5.4 or newer (not tested yet with PHP 5!)
- JSON extension (for older PHP versions)

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

[](#installation)

```
composer require dmitry-kirillov/simplepack
```

Usage
-----

[](#usage)

Objects of this class can be used instead of associative arrays in most scenarios:

```
$data = new Simplepack();
$data['name'] = 'John';
$data['age'] = 30;
$data['is_married'] = true;

foreach ($data as $key => $value) {
    // Your code here...
}
```

However, it is important to remember that certain functions and operators won't work:

```
$keyExists = array_key_exists('name', $data); // PHP Fatal error
$data['age']++; // PHP Notice; the value stays the same
```

Known Issues
------------

[](#known-issues)

- Extremely high CPU usage
- No support for 32-bit systems

License
-------

[](#license)

MIT

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 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

799d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/24413713?v=4)[DmitryKirillov](/maintainers/DmitryKirillov)[@DmitryKirillov](https://github.com/DmitryKirillov)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/dmitry-kirillov-simplepack/health.svg)

```
[![Health](https://phpackages.com/badges/dmitry-kirillov-simplepack/health.svg)](https://phpackages.com/packages/dmitry-kirillov-simplepack)
```

PHPackages © 2026

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