Data structures for PHP 7
Blog post that covers the behaviour and performance benefits of each data structure.
Installation
# Dependencies you might need to install
# sudo add-apt-repository ppa:ondrej/php
# sudo apt-get update
# sudo apt-get install git build-essential php7.0-dev
git clone https://github.com/php-ds/ds "php-ds"
cd php-ds
# Build and install the extension
phpize
./configure
sudo make install
# Clean up the build files
make clean
phpize --clean
Usage
Enabling the extension
The best way to enable the extension is to create an ini file.
# 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
Documentation
See /php/include.
Testing
There is a suite of PHPUnit tests that can be installed using Composer.
The extension has to be installed to run the tests.
Running the tests
composer install
./vendor/bin/phpunit
Contributing
Please see CONTRIBUTING for more information.
Credits
License
The MIT License (MIT). Please see LICENSE for more information.