spl
InvalidArgumentException vs UnexpectedValueException
Looking closely at the descriptions on the manual pages: InvalidArgumentException Exception thrown if an argument is not of the expected type. (The description was Exception thrown if an argument does not match with the expected value. until mid-2014, but was changed when PHP 5.6 got introduced) UnexpectedValueException Exception thrown if a value does not match … Read more
Difference between DirectoryIterator and FileSystemIterator
This goes out of the top of my head, where I sort of got caught in the changes prior to PHP 5.3 that were going to change in 5.3 and later, concerning the SPL (StandardPHPLibrary) and stuff that were going to be moved to the (horrible) PECL extensions. The major thing that changed since 5.3, … Read more
How does RecursiveIteratorIterator work in PHP?
RecursiveIteratorIterator is a concrete Iterator implementing tree traversal. It enables a programmer to traverse a container object that implements the RecursiveIterator interface, see Iterator in Wikipedia for the general principles, types, semantics and patterns of iterators. In difference to IteratorIterator which is a concrete Iterator implementing object traversal in linear order (and by default accepting … Read more