Skip to content
Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge, Google Chrome, or Firefox.

Learn more
An extension providing efficient data structures for PHP 7
Branch: master
Clone or download
Latest commit 266ac80 Feb 23, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Draft implementation of concurrent modification guard Jan 30, 2019
.editorconfig
.gitignore Updates for 7.2 Feb 10, 2017
.travis.yml
.valgrindrc Update .valgrindrc Aug 4, 2017
CHANGELOG.md
CONTRIBUTING.md
LICENSE 1.1.3 Aug 8, 2016
README.md
appveyor.yml Fix Appveyor tests Nov 23, 2018
composer.json
config.m4 Fix pair reflection bugs by avoiding __get and __set Nov 18, 2018
config.w32
package.xml v1.2.8 Jan 25, 2019
php_ds.c
php_ds.h v1.2.8 Jan 25, 2019
phpunit.xml Add phpunit, update test script, fix typo in package Aug 9, 2016
test.php Update test.php Oct 8, 2018

README.md

Data Structures for PHP 7

Build Status PECL

An extension providing 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 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 PECL:

pecl install ds

If you're on Windows, you can download a compiled .dll on PECL or under releases.

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

Please see CONTRIBUTING for more information.

Credits

License

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

You can’t perform that action at this time.