Skip to content

nikic/extension

 
 

Repository files navigation

Data Structures for PHP 7

Build Status Build status PECL

PHP extension providing specialized data structures as efficient alternatives to the array.

Documentation

Documentation is available on php.net. You should also include the polyfill in your project for compatibility and IDE integration. The polyfill will not be loaded if the extension is enabled

Installation

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

pecl install ds

You can also build directly from source:

# Dependencies you might need to install
# sudo apt-get install git build-essential php7.0-dev

git clone https://github.com/php-ds/extension "php-ds"
cd php-ds

# Build and install the extension
phpize
./configure
make 
make install

# Clean up the build files
make clean
phpize --clean

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

Enable

You'll need to add extension=ds.so (or .dll if you're on Windows) to your primary ini file. You can also create a separate ini file for the extension, which allows you to control load order.

# To see where additional .ini files are located
php -i | grep "dir for additional .ini files"

# Create a new .ini file for the extension
echo "extension=ds.so" > /path/to/ini/files/30-ds.ini

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

php -d extension=ds.so

Testing

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

composer install
composer test

Compatibility

It's highly recommended that you 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.

About

An extension providing efficient data structures for PHP 7

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 96.0%
  • C++ 2.7%
  • M4 1.3%