PHPackages                             php-ds/ext-ds - 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. php-ds/ext-ds

ActivePhp-ext[Utility &amp; Helpers](/categories/utility)

php-ds/ext-ds
=============

An extension providing efficient internal data structures as an alternative to arrays

v1.6.0(1y ago)2.1k929↑12.5%98[24 issues](https://github.com/php-ds/ext-ds/issues)[1 PRs](https://github.com/php-ds/ext-ds/pulls)MITCCI failing

Since Jul 30Pushed 2mo ago82 watchersCompare

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

READMEChangelog (10)Dependencies (1)Versions (32)Used By (0)

Native Data Structures for PHP
==============================

[](#native-data-structures-for-php)

[![Build Status](https://github.com/php-ds/ext-ds/workflows/CI/badge.svg)](https://github.com/php-ds/ext-ds/actions?query=workflow%3A%22CI%22+branch%3Amaster)[![Build status](https://camo.githubusercontent.com/24ee745de19d46cbd8774c61afad443bbdd4b7fdf127568906171df3cbe17f6d/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f397730786974703371303468647531643f7376673d74727565)](https://ci.appveyor.com/project/rtheunissen/ext-ds)[![PECL](https://camo.githubusercontent.com/f3d95af80220e87579621229ffc0520f59b38b92ec1eb96abdbf525522ec9d9e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5045434c2d312e362e302d626c75652e737667)](https://pecl.php.net/package/ds)

A PHP language extension that provides specialized data structures as efficient alternatives to the PHP array. You can read about it in more detail [in this blog post](https://medium.com/p/9dda7af674cd) which highlights the API, performance (relative to PHP 7) and other benefits of using the extension.

Documentation
-------------

[](#documentation)

Documentation is available on [php.net](https://www.php.net/manual/en/book.ds.php). You should also include the [polyfill](https://github.com/php-ds/polyfill) in your project for IDE integration.

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

[](#installation)

The easiest way to install the extension is to use PECL:

```
pecl install ds

```

If you're on Windows, you can download a compiled `.dll` on [PECL](https://pecl.php.net/package/ds) or under [releases](https://github.com/php-ds/extension/releases).

Enabling the extension
----------------------

[](#enabling-the-extension)

You'll need to add `extension=ds.so` to your primary `php.ini` file.

If you encounter an "undefined symbol" error, see [\#2](https://github.com/php-ds/extension/issues/2#issuecomment-181855047).

```
# To see where .ini files are located
php -i | grep "\.ini"
```

---

You can also enable the extension temporarily using the command line:

```
php -d extension=ds.so
```

**Note**: Windows would use `php_ds.dll` instead.

Testing
-------

[](#testing)

There is a suite of PHPUnit tests that can be installed using [**Composer**](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx).

```
composer install   # Install the test suite
composer test      # Run the tests
composer memtest   # Run the tests checking for memory leaks
```

Compatibility
-------------

[](#compatibility)

You may include the [polyfill](https://github.com/php-ds/polyfill) as a dependency in your project. This allows your codebase to still function in an environment where the extension is not installed.

Contributing
------------

[](#contributing)

For local development, I'm using Docker:

```
./dev.sh  # opens a shell into a development environment

phpize
./configure
make
make install

composer install
composer test

```

Please see [CONTRIBUTING](CONTRIBUTING.md) for more information.

Credits
-------

[](#credits)

- [Rudi Theunissen](https://github.com/rtheunissen)
- [Joe Watkins](https://github.com/krakjoe)

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance69

Regular maintenance activity

Popularity46

Moderate usage in the ecosystem

Community33

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 87.2% 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 ~110 days

Recently: every ~545 days

Total

30

Last Release

381d ago

Major Versions

v1.2.8 → 2.0.x-dev2019-04-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/761df764fa80c32031884a5dd2376cf7e70c0fa152eaa141fd68f12b4a761b9f?d=identicon)[rtheunissen](/maintainers/rtheunissen)

---

Top Contributors

[![rtheunissen](https://avatars.githubusercontent.com/u/809191?v=4)](https://github.com/rtheunissen "rtheunissen (428 commits)")[![simPod](https://avatars.githubusercontent.com/u/327717?v=4)](https://github.com/simPod "simPod (17 commits)")[![ndossche](https://avatars.githubusercontent.com/u/7771979?v=4)](https://github.com/ndossche "ndossche (7 commits)")[![dktapps](https://avatars.githubusercontent.com/u/14214667?v=4)](https://github.com/dktapps "dktapps (6 commits)")[![Jan-E](https://avatars.githubusercontent.com/u/1757825?v=4)](https://github.com/Jan-E "Jan-E (5 commits)")[![remicollet](https://avatars.githubusercontent.com/u/270445?v=4)](https://github.com/remicollet "remicollet (4 commits)")[![dantudor](https://avatars.githubusercontent.com/u/1281127?v=4)](https://github.com/dantudor "dantudor (3 commits)")[![rvanvelzen](https://avatars.githubusercontent.com/u/102603?v=4)](https://github.com/rvanvelzen "rvanvelzen (3 commits)")[![krakjoe](https://avatars.githubusercontent.com/u/2236138?v=4)](https://github.com/krakjoe "krakjoe (2 commits)")[![asp24](https://avatars.githubusercontent.com/u/488588?v=4)](https://github.com/asp24 "asp24 (2 commits)")[![nbro](https://avatars.githubusercontent.com/u/9349000?v=4)](https://github.com/nbro "nbro (1 commits)")[![nikic](https://avatars.githubusercontent.com/u/216080?v=4)](https://github.com/nikic "nikic (1 commits)")[![NoodlesNZ](https://avatars.githubusercontent.com/u/1063979?v=4)](https://github.com/NoodlesNZ "NoodlesNZ (1 commits)")[![siimsoni](https://avatars.githubusercontent.com/u/1738636?v=4)](https://github.com/siimsoni "siimsoni (1 commits)")[![jfcherng](https://avatars.githubusercontent.com/u/6594915?v=4)](https://github.com/jfcherng "jfcherng (1 commits)")[![assertchris](https://avatars.githubusercontent.com/u/200609?v=4)](https://github.com/assertchris "assertchris (1 commits)")[![BenMorel](https://avatars.githubusercontent.com/u/1952838?v=4)](https://github.com/BenMorel "BenMorel (1 commits)")[![cmb69](https://avatars.githubusercontent.com/u/2306138?v=4)](https://github.com/cmb69 "cmb69 (1 commits)")[![colinmollenhour](https://avatars.githubusercontent.com/u/38738?v=4)](https://github.com/colinmollenhour "colinmollenhour (1 commits)")[![glensc](https://avatars.githubusercontent.com/u/199095?v=4)](https://github.com/glensc "glensc (1 commits)")

---

Tags

data-structuresextensionpeclphp

### Embed Badge

![Health badge](/badges/php-ds-ext-ds/health.svg)

```
[![Health](https://phpackages.com/badges/php-ds-ext-ds/health.svg)](https://phpackages.com/packages/php-ds-ext-ds)
```

PHPackages © 2026

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