Skip to content

PHP SPL Methods

Category Type Name Intro line Docs link
Datastructures class SplDoublyLinkedList The SplDoublyLinkedList class provides the main functionalities of a doubly linked list. https://www.php.net/manual/en/class.spldoublylinkedlist.php
Datastructures class SplStack The SplStack class provides the main functionalities of a stack implemented using a doubly linked list. https://www.php.net/manual/en/class.splstack.php
Datastructures class SplQueue The SplQueue class provides the main functionalities of a queue implemented using a doubly linked list. https://www.php.net/manual/en/class.splqueue.php
Datastructures class SplHeap The SplHeap class provides the main functionalities of a Heap. https://www.php.net/manual/en/class.splheap.php
Datastructures class SplMaxHeap The SplMaxHeap class provides the main functionalities of a heap, keeping the maximum on the top. https://www.php.net/manual/en/class.splmaxheap.php
Datastructures class SplMinHeap The SplMinHeap class provides the main functionalities of a heap, keeping the minimum on the top. https://www.php.net/manual/en/class.splminheap.php
Datastructures class SplPriorityQueue The SplPriorityQueue class provides the main functionalities of a prioritized queue, implemented using a max heap. https://www.php.net/manual/en/class.splpriorityqueue.php
Datastructures class SplFixedArray The SplFixedArray class provides the main functionalities of array. The main differences between a SplFixedArray and a normal PHP array is that the SplFixedArray is of fixed length and allows only integers within the range as indexes. The advantage is that it uses less memory than a standard array. https://www.php.net/manual/en/class.splfixedarray.php
Datastructures class SplObjectStorage The SplObjectStorage class provides a map from objects to data or, by ignoring data, an object set. This dual purpose can be useful in many cases involving the need to uniquely identify objects. https://www.php.net/manual/en/class.splobjectstorage.php
Iterators class AppendIterator An Iterator that iterates over several iterators one after the other. https://www.php.net/manual/en/class.appenditerator.php
Iterators class ArrayIterator This iterator allows to unset and modify values and keys while iterating over Arrays and Objects. When you want to iterate over the same array multiple times you need to instantiate ArrayObject and let it create ArrayIterator instances that refer to it either by using foreach or by calling its getIterator() method manually." https://www.php.net/manual/en/class.arrayiterator.php
Iterators class CachingIterator This object supports cached iteration over another iterator. https://www.php.net/manual/en/class.cachingiterator.php
Iterators class CallbackFilterIterator The callback should accept up to three arguments: the current item, the current key and the iterator, respectively. https://www.php.net/manual/en/class.callbackfilteriterator.php
Iterators class DirectoryIterator The DirectoryIterator class provides a simple interface for viewing the contents of filesystem directories. https://www.php.net/manual/en/class.directoryiterator.php
Iterators class EmptyIterator The EmptyIterator class for an empty iterator. https://www.php.net/manual/en/class.emptyiterator.php
Iterators class FilesystemIterator The Filesystem iterator https://www.php.net/manual/en/class.filesystemiterator.php
Iterators class FilterIterator This abstract iterator filters out unwanted values. This class should be extended to implement custom iterator filters. The FilterIterator::accept() must be implemented in the subclass. https://www.php.net/manual/en/class.filteriterator.php
Iterators class GlobIterator Iterates through a file system in a similar fashion to glob(). https://www.php.net/manual/en/class.globiterator.php
Iterators class InfiniteIterator The InfiniteIterator allows one to infinitely iterate over an iterator without having to manually rewind the iterator upon reaching its end. https://www.php.net/manual/en/class.infiniteiterator.php
Iterators class IteratorIterator This iterator wrapper allows the conversion of anything that is Traversable into an Iterator. It is important to understand that most classes that do not implement Iterators have reasons as most likely they do not allow the full Iterator feature set. If so, techniques should be provided to prevent misuse, otherwise expect exceptions or fatal errors. https://www.php.net/manual/en/class.iteratoriterator.php
Iterators class LimitIterator The LimitIterator class allows iteration over a limited subset of items in an Iterator. https://www.php.net/manual/en/class.limititerator.php
Iterators class MultipleIterator An Iterator that sequentially iterates over all attached iterators https://www.php.net/manual/en/class.multipleiterator.php
Iterators class NoRewindIterator This iterator ignores rewind operations. This allows processing an iterator in multiple partial foreach loops. https://www.php.net/manual/en/class.norewinditerator.php
Iterators class ParentIterator This extended FilterIterator allows a recursive iteration using RecursiveIteratorIterator that only shows those elements which have children. https://www.php.net/manual/en/class.parentiterator.php
Iterators class RecursiveArrayIterator This iterator allows to unset and modify values and keys while iterating over Arrays and Objects in the same way as the ArrayIterator. Additionally it is possible to iterate over the current iterator entry. https://www.php.net/manual/en/class.recursivearrayiterator.php
Iterators class RecursiveCachingIterator https://www.php.net/manual/en/class.recursivecachingiterator.php
Iterators class RecursiveCallbackFilterIterator The callback should accept up to three arguments: the current item, the current key and the iterator, respectively. https://www.php.net/manual/en/class.recursivecallbackfilteriterator.php
Iterators class RecursiveDirectoryIterator The RecursiveDirectoryIterator provides an interface for iterating recursively over filesystem directories. https://www.php.net/manual/en/class.recursivedirectoryiterator.php
Iterators class RecursiveFilterIterator This abstract iterator filters out unwanted values for a RecursiveIterator. This class should be extended to implement custom filters. The RecursiveFilterIterator::accept() must be implemented in the subclass. https://www.php.net/manual/en/class.recursivefilteriterator.php
Iterators class RecursiveIteratorIterator Can be used to iterate through recursive iterators. https://www.php.net/manual/en/class.recursiveiteratoriterator.php
Iterators class RecursiveRegexIterator This recursive iterator can filter another recursive iterator via a regular expression. https://www.php.net/manual/en/class.recursiveregexiterator.php
Iterators class RecursiveTreeIterator Allows iterating over a RecursiveIterator to generate an ASCII graphic tree. https://www.php.net/manual/en/class.recursivetreeiterator.php
Iterators class RegexIterator This iterator can be used to filter another iterator based on a regular expression. https://www.php.net/manual/en/class.regexiterator.php
Interfaces interface Countable Classes implementing Countable can be used with the count() function. https://www.php.net/manual/en/class.countable.php
Interfaces interface OuterIterator Classes implementing OuterIterator can be used to iterate over iterators. https://www.php.net/manual/en/class.outeriterator.php
Interfaces interface RecursiveIterator Classes implementing RecursiveIterator can be used to iterate over iterators recursively. https://www.php.net/manual/en/class.recursiveiterator.php
Interfaces interface SeekableIterator The Seekable iterator. https://www.php.net/manual/en/class.seekableiterator.php
Exceptions class BadFunctionCallException Exception thrown if a callback refers to an undefined function or if some arguments are missing. https://www.php.net/manual/en/class.badfunctioncallexception.php
Exceptions class BadMethodCallException Exception thrown if a callback refers to an undefined method or if some arguments are missing. https://www.php.net/manual/en/class.badmethodcallexception.php
Exceptions class DomainException Exception thrown if a value does not adhere to a defined valid data domain. https://www.php.net/manual/en/class.domainexception.php
Exceptions class InvalidArgumentException Exception thrown if an argument is not of the expected type. https://www.php.net/manual/en/class.invalidargumentexception.php
Exceptions class LengthException Exception thrown if a length is invalid. https://www.php.net/manual/en/class.lengthexception.php
Exceptions class LogicException Exception that represents error in the program logic. This kind of exception should lead directly to a fix in your code. https://www.php.net/manual/en/class.logicexception.php
Exceptions class OutOfBoundsException Exception thrown if a value is not a valid key. This represents errors that cannot be detected at compile time. https://www.php.net/manual/en/class.outofboundsexception.php
Exceptions class OutOfRangeException Exception thrown when an illegal index was requested. This represents errors that should be detected at compile time. https://www.php.net/manual/en/class.outofrangeexception.php
Exceptions class OverflowException Exception thrown when adding an element to a full container. https://www.php.net/manual/en/class.overflowexception.php
Exceptions class RangeException Exception thrown to indicate range errors during program execution. Normally this means there was an arithmetic error other than under/overflow. This is the runtime version of DomainException. https://www.php.net/manual/en/class.rangeexception.php
Exceptions class RuntimeException Exception thrown if an error which can only be found on runtime occurs. https://www.php.net/manual/en/class.runtimeexception.php
Exceptions class UnderflowException Exception thrown when performing an invalid operation on an empty container, such as removing an element. https://www.php.net/manual/en/class.underflowexception.php
Exceptions class UnexpectedValueException Exception thrown if a value does not match with a set of values. Typically this happens when a function calls another function and expects the return value to be of a certain type or value not including arithmetic or buffer related errors. https://www.php.net/manual/en/class.unexpectedvalueexception.php
SPL functions function class_implements Return the interfaces which are implemented by the given class or interface https://www.php.net/manual/en/function.class-implements.php
SPL functions function class_parents Return the parent classes of the given class https://www.php.net/manual/en/function.class-parents.php
SPL functions function class_uses Return the traits used by the given class https://www.php.net/manual/en/function.class-uses.php
SPL functions function iterator_apply Call a function for every element in an iterator https://www.php.net/manual/en/function.iterator-apply.php
SPL functions function iterator_count Count the elements in an iterator https://www.php.net/manual/en/function.iterator-count.php
SPL functions function iterator_to_array Copy the iterator into an array https://www.php.net/manual/en/function.iterator-to-array.php
SPL functions function spl_autoload_call Try all registered __autoload() functions to load the requested class https://www.php.net/manual/en/function.spl-autoload-call.php
SPL functions function spl_autoload_extensions Register and return default file extensions for spl_autoload https://www.php.net/manual/en/function.spl-autoload-extensions.php
SPL functions function spl_autoload_functions Return all registered __autoload() functions https://www.php.net/manual/en/function.spl-autoload-functions.php
SPL functions function spl_autoload_register Register given function as __autoload() implementation https://www.php.net/manual/en/function.spl-autoload-register.php
SPL functions function spl_autoload_unregister Unregister given function as __autoload() implementation https://www.php.net/manual/en/function.spl-autoload-unregister.php
SPL functions function spl_autoload Default implementation for __autoload() https://www.php.net/manual/en/function.spl-autoload.php
SPL functions function spl_classes Return available SPL classes https://www.php.net/manual/en/function.spl-classes.php
SPL functions function spl_object_hash Return hash id for given object https://www.php.net/manual/en/function.spl-object-hash.php
SPL functions function spl_object_id Return the integer object handle for given object https://www.php.net/manual/en/function.spl-object-id.php
File Handling class SplFileInfo The SplFileInfo class offers a high-level object oriented interface to information for an individual file. https://www.php.net/manual/en/class.splfileinfo.php
File Handling class SplFileObject The SplFileObject class offers an object oriented interface for a file. https://www.php.net/manual/en/class.splfileobject.php
File Handling class SplTempFileObject The SplTempFileObject class offers an object oriented interface for a temporary file. https://www.php.net/manual/en/class.spltempfileobject.php
Miscellaneous class ArrayObject This class allows objects to work as arrays. https://www.php.net/manual/en/class.arrayobject.php
Miscellaneous interface SplObserver The SplObserver interface is used alongside SplSubject to implement the Observer Design Pattern. https://www.php.net/manual/en/class.splobserver.php
Miscellaneous interface SplSubject The SplSubject interface is used alongside SplObserver to implement the Observer Design Pattern. https://www.php.net/manual/en/class.splsubject.php