• PHP Video Tutorials

PHP - DS Collection Functions



The Collection is a base interface that covers functionality common to all data structures in this library. It guarantees that all structures are traversable, countable, and can be converted to json using the json_encode() function.

Interface synopsis

Ds\Collection implements Traversable, Countable, JsonSerializable {
   /* Methods */
   abstract public void clear ( void )
   abstract public Ds\Collection copy ( void )
   abstract public bool isEmpty ( void )
   abstract public array toArray ( void )
}

Sr.No Function & Description
1

Ds\Collection::clear()

Ds\Collection::clear() function can remove all values.

2

Ds\Collection::copy()

Ds\Collection::copy() function can return a shallow copy of the collection.

3

Ds\Collection::isEmpty()

Ds\Collection::isEmpty() function can return whether the collection is empty.

4

Ds\Collection::toArray()

Ds\Collection::toArray() function can convert the collection to an array.

php_function_reference.htm
Advertisements