spl_classes()
spl_classes() — Return available SPL classes.
Built-in function of PHP 8.5. The manual lists it as available in PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.
What it does
This function returns an array with the current available SPL classes.
Signature
spl_classes(): array
Parameters
This function takes no parameters.
Return value
Returns an array containing the currently available SPL classes.
Example
A runnable snippet:
print_r(spl_classes());
Output:
Array ( [ArrayObject] => ArrayObject [ArrayIterator] => ArrayIterator [CachingIterator] => CachingIterator [RecursiveCachingIterator] => RecursiveCachingIterator [DirectoryIterator] => DirectoryIterator [FilterIterator] => FilterIterator [LimitIterator] => LimitIterator [ParentIterator] => ParentIterator [RecursiveDirectoryIterator] => RecursiveDirectoryIterator [RecursiveIterator] => RecursiveIterator [RecursiveIteratorIterator] => RecursiveIteratorIterator [SeekableIterator] => SeekableIterator [SimpleXMLIterator] => SimpleXMLIterator )
All PHP 8.5 built-in functions
Reference card built from the PHP manual page spl_classes() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.