Introduction

PHP SEIDS is a library providing a variety of data structures designed to complement those provided by the Standard PHP Library (SPL). Wherever possible the classes provide the same interface as provided by a related SPL class, sometimes with extra functionality. This allows for the classes to be easily swapped with both one another and the original SPL classes.

One should be aware that whilst these classes provide alternative implementations to the SPL classes, and often extra functionality, they are not fast. This is due to this library being implemented in PHP rather than C as the original SPL classes are. For that reason it is generally better to use the SPL classes if you know you do not need the extra functionality provided here. The compatible interfaces of the classes makes this transition very easy.

The most useful classes in this library are probably the ArrayDeque class and the classes based on the Pairing Heap (including its priority queue).

The ArrayDeque class is useful when one wants an array that only takes integers as keys and takes up less space than standard arrays (the benefits provided by » SplFixedArray) but does not know before-hand how large the array must be or otherwise wishes to automatically grow or shrink the array in the course of the program.

The Pairing Heap classes (and the associated Priority Queue classes) are useful when one needs an updatable heap (or indeed an updatable priority queue). If the ability to update the heap is not required then one should use the faster binary heap implementation provided by » SplHeap.

To Top