Blog posts tagged with 'regexiterator':

SPL Deepdive: RegexIterator

Date: 12 Feb 2014
Tags: [ regexiterator ]  [ spl

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.


PHP 5.4: RegexIterator::getRegex()

Date: 06 Jan 2011
Tags: [ core ]  [ patch ]  [ PHP ]  [ regexiterator ]  [ spl

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.