Search by

stefna / ext-ds

sunkan

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

Package info

github.com/stefna/ext-ds

Language:C

Type:php-ext

Ext name:ext-ds

pkg:composer/stefna/ext-ds

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

v1.9.0 2026-12-03 21:49 UTC

README

Build Status Latest Version on Packagist Software License

This permanent fork maintains the extension's 1.x series

This is for users who need an alternative to the extensive breaking changes introduced in v2.

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 which highlights the API, performance (relative to PHP 7) and other benefits of using the extension.

Documentation

Documentation is available on php.net. You should also include the polyfill in your project for IDE integration.

Installation

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

pie install stefna/ext-ds

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.

# 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

There is a suite of PHPUnit tests that can be installed using Composer.

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

Compatibility

You may include the polyfill as a dependency in your project. This allows your codebase to still function in an environment where the extension is not installed.

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 for more information.

Credits

License

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