Assorted SPL Iterator Examples

This is an assorted list for three SPL iterator resources out there in the net. I’m sure there is more, so feel free to leave a comment I’m happy to add them.

spl-examples (salathe)

The idea is to have you folks add a few choice tidbits of goodness you have stumbled over when using the SPL (Standard PHP Library).

The (not so) secret motivation here is to get some nice examples to go in the PHP documentation.🙂

Examples:

  • SplHeap (SplMinHeap; SplMaxHeap)
  • SortingIterator
  • FilterChainIterator
  • RecursiveDOMIterator

Link: https://github.com/salathe/spl-examples

PHP-SPL-Iterator-Interface-Examples (cballou)

This repository aims to be a community wiki (a la git pull requests) of useful PHP Standard Template Library (SPL) examples. The php.net website lacks user submitted examples in the SPL department, so Queen City PHP (http://qcphp.org) is taking the initiative to provide examples and spread the word.

All of the base level PHP files are working examples of their SPL iterator counterparts. Documentation will be added to the readme in the future.

Examples:

  • NavBuilder (CachingIterator)
  • Observable (SplSubject; SplObserver)
  • RecursiveRegexIterator

Link: https://github.com/cballou/PHP-SPL-Iterator-Interface-Examples

iterator_madness.inc.php

By Marcus Börger, SPL PHP core hacker

Examples:

  • DecoratingIterator
  • DualIterator
  • KeyValueIterator
  • DecoratingKeyValueIterator
  • KeyIterator
  • SugarDualIteratorIterator

Link: http://code.google.com/p/cvphplib/…/iterator_madness.inc.php

This entry was posted in Hakre's Tips and tagged , , , , , , . Bookmark the permalink.

4 Responses to Assorted SPL Iterator Examples

  1. mikeschinkel says:

    @hakre Did you notice spl-examples (salathe) was created 2 years ago and has only 1 commit and zero code examples?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s