SPHPlayground API
SPHPlayground
sphplayground sphplayground

Datastructures: Colection - A jack of all trades

The Standard PHP Library (SPL) provides a set of standard data structures, and there is also a PECL package Efficient data structures for PHP 7 available for some systems. SPHP framework introduces a few extensions and add-ons to this set.

Synopsis
Appends a new value as the last element
public append(mixed $value):static
Prepends a new value as the first element
public prepend(mixed $value):static
Determine if the collection is empty or not
public isEmpty():bool
Clears the contents
public clear():static
Checks whether a value exists in the collection
public contains(mixed $value):bool
Removes all instances of the given value
public remove(mixed $value):static
Serializes to an array
public toArray():array