Top "Spl" questions

SPL is a collection of PHP interfaces and classes that are meant to solve standard problems.

Spl, ArrayObject, ArrayObject::STD_PROP_LIST

I'm trying to understand STD_PROP_LIST constant in the documentation but so far i didn´t understand it, and …

php spl arrayobject
Associative Array versus SplObjectStorage

I'm working on code to manage a collection of unique objects. The first prototype of this code utilises an associative …

php oop associative-array spl
Using spl_autoload() not able to load class

I'm playing around with the SPL autoload functionality and seem to be missing something important as I am currently unable …

php spl spl-autoloader
Does PHP 5.x have some kind of HashSet or Set Class?

I'm used to Java where I have HashSets, ArrayLists and other Collections. But I'm workting on a PHP project right …

php data-structures spl
Sort directory listing using RecursiveDirectoryIterator

I'm using RecursiveDirectoryIterator and RecursiveIteratorIterator to build a file listing tree using code like below. I need to the list …

php sorting recursion spl
InvalidArgumentException vs UnexpectedValueException

When should I use InvalidArgumentException and when UnexpectedValueException? They look the same to me. Note that one extends LogicException and …

php exception spl
after using $files = new DirectoryIterator() in PHP, how do you sort the items?

We can get the files in a directory in PHP by $files = new DirectoryIterator() after that is there an easy …

php sorting spl
How to get number of lines with SplFileObject?

$file = new SplFileObject('/path/to/file.txt'); How can I find the number of lines in a file with …

php spl
Using RecursiveIteratorIterator to list files in folder is great. Can I get the parent path and full path as well?

I need to list all files (which have certain extensions) in a folder and its sub-folders. I used RecursiveIteratorIterator as …

php file spl
OutOfRangeException vs. OutOfBoundsException

PHP defines two SPL exceptions for invalid keys: OutOfRangeException: Exception thrown when an illegal index was requested. This represents errors …

php exception spl