Better PHP Documentation
opinionated
Open main menu
Get Started
Documentation
Community
Training
Better PHP Documentation
Close menu
Get Started
Documentation
Community
Training
Log in
Change language:
English
German
Spanish
French
Italian
Japanese
Brazilian Portuguese
Russian
Turkish
Ukrainian
Chinese (Simplified)
Other
Data Structures
Introduction
Installing/Configuring
Requirements
Installation
Examples
Ds\Collection
β The Collection interface
Ds\Collection::clear
β Removes all values
Ds\Collection::copy
β Returns a shallow copy of the collection
Ds\Collection::isEmpty
β Returns whether the collection is empty
Ds\Collection::toArray
β Converts the collection to an array
Ds\Hashable
β The Hashable interface
Ds\Hashable::equals
β Determines whether an object is equal to the current instance
Ds\Hashable::hash
β Returns a scalar value to be used as a hash value
Ds\Sequence
β The Sequence interface
Ds\Sequence::allocate
β Allocates enough memory for a required capacity
Ds\Sequence::apply
β Updates all values by applying a callback function to each value
Ds\Sequence::capacity
β Returns the current capacity
Ds\Sequence::contains
β Determines if the sequence contains given values
Ds\Sequence::filter
β Creates a new sequence using a callable to determine which values to include
Ds\Sequence::find
β Attempts to find a value's index
Ds\Sequence::first
β Returns the first value in the sequence
Ds\Sequence::get
β Returns the value at a given index
Ds\Sequence::insert
β Inserts values at a given index
Ds\Sequence::join
β Joins all values together as a string
Ds\Sequence::last
β Returns the last value
Ds\Sequence::map
β Returns the result of applying a callback to each value
Ds\Sequence::merge
β Returns the result of adding all given values to the sequence
Ds\Sequence::pop
β Removes and returns the last value
Ds\Sequence::push
β Adds values to the end of the sequence
Ds\Sequence::reduce
β Reduces the sequence to a single value using a callback function
Ds\Sequence::remove
β Removes and returns a value by index
Ds\Sequence::reverse
β Reverses the sequence in-place
Ds\Sequence::reversed
β Returns a reversed copy
Ds\Sequence::rotate
β Rotates the sequence by a given number of rotations
Ds\Sequence::set
β Updates a value at a given index
Ds\Sequence::shift
β Removes and returns the first value
Ds\Sequence::slice
β Returns a sub-sequence of a given range
Ds\Sequence::sort
β Sorts the sequence in-place
Ds\Sequence::sorted
β Returns a sorted copy
Ds\Sequence::sum
β Returns the sum of all values in the sequence
Ds\Sequence::unshift
β Adds values to the front of the sequence
Ds\Vector
β The Vector class
Ds\Vector::allocate
β Allocates enough memory for a required capacity
Ds\Vector::apply
β Updates all values by applying a callback function to each value
Ds\Vector::capacity
β Returns the current capacity
Ds\Vector::clear
β Removes all values
Ds\Vector::__construct
β Creates a new instance
Ds\Vector::contains
β Determines if the vector contains given values
Ds\Vector::copy
β Returns a shallow copy of the vector
Ds\Vector::count
β Returns the number of values in the collection
Ds\Vector::filter
β Creates a new vector using a callable to determine which values to include
Ds\Vector::find
β Attempts to find a value's index
Ds\Vector::first
β Returns the first value in the vector
Ds\Vector::get
β Returns the value at a given index
Ds\Vector::insert
β Inserts values at a given index
Ds\Vector::isEmpty
β Returns whether the vector is empty
Ds\Vector::join
β Joins all values together as a string
Ds\Vector::jsonSerialize
β Returns a representation that can be converted to JSON
Ds\Vector::last
β Returns the last value
Ds\Vector::map
β Returns the result of applying a callback to each value
Ds\Vector::merge
β Returns the result of adding all given values to the vector
Ds\Vector::pop
β Removes and returns the last value
Ds\Vector::push
β Adds values to the end of the vector
Ds\Vector::reduce
β Reduces the vector to a single value using a callback function
Ds\Vector::remove
β Removes and returns a value by index
Ds\Vector::reverse
β Reverses the vector in-place
Ds\Vector::reversed
β Returns a reversed copy
Ds\Vector::rotate
β Rotates the vector by a given number of rotations
Ds\Vector::set
β Updates a value at a given index
Ds\Vector::shift
β Removes and returns the first value
Ds\Vector::slice
β Returns a sub-vector of a given range
Ds\Vector::sort
β Sorts the vector in-place
Ds\Vector::sorted
β Returns a sorted copy
Ds\Vector::sum
β Returns the sum of all values in the vector
Ds\Vector::toArray
β Converts the vector to an array
Ds\Vector::unshift
β Adds values to the front of the vector
Ds\Deque
β The Deque class
Ds\Deque::allocate
β Allocates enough memory for a required capacity
Ds\Deque::apply
β Updates all values by applying a callback function to each value
Ds\Deque::capacity
β Returns the current capacity
Ds\Deque::clear
β Removes all values from the deque
Ds\Deque::__construct
β Creates a new instance
Ds\Deque::contains
β Determines if the deque contains given values
Ds\Deque::copy
β Returns a shallow copy of the deque
Ds\Deque::count
β Returns the number of values in the collection
Ds\Deque::filter
β Creates a new deque using a callable to determine which values to include
Ds\Deque::find
β Attempts to find a value's index
Ds\Deque::first
β Returns the first value in the deque
Ds\Deque::get
β Returns the value at a given index
Ds\Deque::insert
β Inserts values at a given index
Ds\Deque::isEmpty
β Returns whether the deque is empty
Ds\Deque::join
β Joins all values together as a string
Ds\Deque::jsonSerialize
β Returns a representation that can be converted to JSON
Ds\Deque::last
β Returns the last value
Ds\Deque::map
β Returns the result of applying a callback to each value
Ds\Deque::merge
β Returns the result of adding all given values to the deque
Ds\Deque::pop
β Removes and returns the last value
Ds\Deque::push
β Adds values to the end of the deque
Ds\Deque::reduce
β Reduces the deque to a single value using a callback function
Ds\Deque::remove
β Removes and returns a value by index
Ds\Deque::reverse
β Reverses the deque in-place
Ds\Deque::reversed
β Returns a reversed copy
Ds\Deque::rotate
β Rotates the deque by a given number of rotations
Ds\Deque::set
β Updates a value at a given index
Ds\Deque::shift
β Removes and returns the first value
Ds\Deque::slice
β Returns a sub-deque of a given range
Ds\Deque::sort
β Sorts the deque in-place
Ds\Deque::sorted
β Returns a sorted copy
Ds\Deque::sum
β Returns the sum of all values in the deque
Ds\Deque::toArray
β Converts the deque to an array
Ds\Deque::unshift
β Adds values to the front of the deque
Ds\Map
β The Map class
Ds\Map::allocate
β Allocates enough memory for a required capacity
Ds\Map::apply
β Updates all values by applying a callback function to each value
Ds\Map::capacity
β Returns the current capacity
Ds\Map::clear
β Removes all values
Ds\Map::__construct
β Creates a new instance
Ds\Map::copy
β Returns a shallow copy of the map
Ds\Map::count
β Returns the number of values in the map
Ds\Map::diff
β Creates a new map using keys that aren't in another map
Ds\Map::filter
β Creates a new map using a callable to determine which pairs to include
Ds\Map::first
β Returns the first pair in the map
Ds\Map::get
β Returns the value for a given key
Ds\Map::hasKey
β Determines whether the map contains a given key
Ds\Map::hasValue
β Determines whether the map contains a given value
Ds\Map::intersect
β Creates a new map by intersecting keys with another map
Ds\Map::isEmpty
β Returns whether the map is empty
Ds\Map::jsonSerialize
β Returns a representation that can be converted to JSON
Ds\Map::keys
β Returns a set of the map's keys
Ds\Map::ksort
β Sorts the map in-place by key
Ds\Map::ksorted
β Returns a copy, sorted by key
Ds\Map::last
β Returns the last pair of the map
Ds\Map::map
β Returns the result of applying a callback to each value
Ds\Map::merge
β Returns the result of adding all given associations
Ds\Map::pairs
β Returns a sequence containing all the pairs of the map
Ds\Map::put
β Associates a key with a value
Ds\Map::putAll
β Associates all key-value pairs of a traversable object or array
Ds\Map::reduce
β Reduces the map to a single value using a callback function
Ds\Map::remove
β Removes and returns a value by key
Ds\Map::reverse
β Reverses the map in-place
Ds\Map::reversed
β Returns a reversed copy
Ds\Map::skip
β Returns the pair at a given positional index
Ds\Map::slice
β Returns a subset of the map defined by a starting index and length
Ds\Map::sort
β Sorts the map in-place by value
Ds\Map::sorted
β Returns a copy, sorted by value
Ds\Map::sum
β Returns the sum of all values in the map
Ds\Map::toArray
β Converts the map to an array
Ds\Map::union
β Creates a new map using values from the current instance and another map
Ds\Map::values
β Returns a sequence of the map's values
Ds\Map::xor
β Creates a new map using keys of either the current instance or of another map, but not of both
Ds\Pair
β The Pair class
Ds\Pair::clear
β Removes all values
Ds\Pair::__construct
β Creates a new instance
Ds\Pair::copy
β Returns a shallow copy of the pair
Ds\Pair::isEmpty
β Returns whether the pair is empty
Ds\Pair::jsonSerialize
β Returns a representation that can be converted to JSON
Ds\Pair::toArray
β Converts the pair to an array
Ds\Set
β The Set class
Ds\Set::add
β Adds values to the set
Ds\Set::allocate
β Allocates enough memory for a required capacity
Ds\Set::capacity
β Returns the current capacity
Ds\Set::clear
β Removes all values
Ds\Set::__construct
β Creates a new instance
Ds\Set::contains
β Determines if the set contains all values
Ds\Set::copy
β Returns a shallow copy of the set
Ds\Set::count
β Returns the number of values in the set
Ds\Set::diff
β Creates a new set using values that aren't in another set
Ds\Set::filter
β Creates a new set using a callable to determine which values to include
Ds\Set::first
β Returns the first value in the set
Ds\Set::get
β Returns the value at a given index
Ds\Set::intersect
β Creates a new set by intersecting values with another set
Ds\Set::isEmpty
β Returns whether the set is empty
Ds\Set::join
β Joins all values together as a string
Ds\Set::jsonSerialize
β Returns a representation that can be converted to JSON
Ds\Set::last
β Returns the last value in the set
Ds\Set::map
β Returns the result of applying a callback to each value
Ds\Set::merge
β Returns the result of adding all given values to the set
Ds\Set::reduce
β Reduces the set to a single value using a callback function
Ds\Set::remove
β Removes all given values from the set
Ds\Set::reverse
β Reverses the set in-place
Ds\Set::reversed
β Returns a reversed copy
Ds\Set::slice
β Returns a sub-set of a given range
Ds\Set::sort
β Sorts the set in-place
Ds\Set::sorted
β Returns a sorted copy
Ds\Set::sum
β Returns the sum of all values in the set
Ds\Set::toArray
β Converts the set to an array
Ds\Set::union
β Creates a new set using values from the current instance and another set
Ds\Set::xor
β Creates a new set using values in either the current instance or in another set, but not in both
Ds\Stack
β The Stack class
Ds\Stack::allocate
β Allocates enough memory for a required capacity
Ds\Stack::capacity
β Returns the current capacity
Ds\Stack::clear
β Removes all values
Ds\Stack::__construct
β Creates a new instance
Ds\Stack::copy
β Returns a shallow copy of the stack
Ds\Stack::count
β Returns the number of values in the stack
Ds\Stack::isEmpty
β Returns whether the stack is empty
Ds\Stack::jsonSerialize
β Returns a representation that can be converted to JSON
Ds\Stack::peek
β Returns the value at the top of the stack
Ds\Stack::pop
β Removes and returns the value at the top of the stack
Ds\Stack::push
β Pushes values onto the stack
Ds\Stack::toArray
β Converts the stack to an array
Ds\Queue
β The Queue class
Ds\Queue::allocate
β Allocates enough memory for a required capacity
Ds\Queue::capacity
β Returns the current capacity
Ds\Queue::clear
β Removes all values
Ds\Queue::__construct
β Creates a new instance
Ds\Queue::copy
β Returns a shallow copy of the queue
Ds\Queue::count
β Returns the number of values in the queue
Ds\Queue::isEmpty
β Returns whether the queue is empty
Ds\Queue::jsonSerialize
β Returns a representation that can be converted to JSON
Ds\Queue::peek
β Returns the value at the front of the queue
Ds\Queue::pop
β Removes and returns the value at the front of the queue
Ds\Queue::push
β Pushes values into the queue
Ds\Queue::toArray
β Converts the queue to an array
Ds\PriorityQueue
β The PriorityQueue class
Ds\PriorityQueue::allocate
β Allocates enough memory for a required capacity
Ds\PriorityQueue::capacity
β Returns the current capacity
Ds\PriorityQueue::clear
β Removes all values
Ds\PriorityQueue::__construct
β Creates a new instance
Ds\PriorityQueue::copy
β Returns a shallow copy of the queue
Ds\PriorityQueue::count
β Returns the number of values in the queue
Ds\PriorityQueue::isEmpty
β Returns whether the queue is empty
Ds\PriorityQueue::jsonSerialize
β Returns a representation that can be converted to JSON
Ds\PriorityQueue::peek
β Returns the value at the front of the queue
Ds\PriorityQueue::pop
β Removes and returns the value with the highest priority
Ds\PriorityQueue::push
β Pushes values into the queue
Ds\PriorityQueue::toArray
β Converts the queue to an array
Found A Problem?
Learn How To Improve This Page
β’
Submit a Pull Request
β’
Report a Bug
οΌ
add a note
User Contributed Notes
There are no user contributed notes for this page.
0
pcntl_sigtimedwait
Waits for signals, with a timeout
0
similar_text
Calculate the similarity between two strings
0
boolval
Get the boolean value of a variable
0
curl_multi_close
Close a set of cURL handles
0
imap_body
Read the message body
0
mb_strpos
Find position of first occurrence of string in a string
0
pg_send_prepare
Sends a request to create a prepared statement with the given parameters, without waiting for completion
0
swoole_native_socket_bind
0
Arr::prependKeysWith
0
zend_version
Gets the version of the current Zend engine
^