-
Notifications
You must be signed in to change notification settings - Fork 5
Home
Peter Cowburn edited this page Aug 10, 2013
·
6 revisions
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. :-)
Use this wiki to add your code, descriptions, thoughts, irritations, whatever.
If you have a GitHub account, you can create new pages and edit existing ones.
- Class Interface Graph gives an overview of what the SPL contains (classes and interfaces)
-
SplHeap describes the basic usage of
SplMaxHeap
and notes a potential gotcha when re-using thecompare
method with basic array functions likeusort
- Sorting Iterators gives a brief example of a common approach to sorting the items in an iterator
- FilterChain Iterator gives an example of a bespoke filtering iterator which uses Closures (or any "callable" value) to allow multiple filters to be stacked together
- RecursiveDOMIterator gives an example of how to implement the RecursiveIterator interface to create a custom iterator that allows traversing DOM documents.
- RandomLineIterator gives an example of an OuterIterator that iterates over the lines in an SplFileObject randomly without loading the file into memory first.
- Appendices
- Class Constants gives a list of constants defined for SPL classes. More pages will be added to this list as they're written.