Posts Tagged ‘ spl ’

SPL: Using the iteratorAggregate interface

December 4, 2011
By

The SPL is one of hardest things to grasp for most PHP developers. But why is this? The lack of documentation inside the manual, the fact that there are not many real-life examples, or maybe it’s just too hard? In this post I will try to explain a bit more about the “iteratorAggregate” interface. Together…

Read more »

PHP 5.4: RegexIterator::getRegex()

January 6, 2011
By

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…

Read more »