If everything goes according to plan (which never is the case), I’ll try and highlight some of the fascinating stuff that can be found inside the SPL. I do a lot of presentations about the SPL, and one of the things I like to tell people is that even though the SPL, - iterators particularly - is a magnificent piece of code that is often underused and misunderstood, it does come with some quirks and glitches that aren’t documented properly.
Recently, my colleague Jeroen van Dijk needed to extend (or better yet: override) the
accept()* method for the RegexIterator. Turns out this wasn’t as easy as it might sound in practice. So after extending
and overriding multiple methods he found an acceptable solution. But there is room for improvement. And starting from
PHP 5.4, this improvement is available through regexiterator::getregex()
method.