1. New SPL Features in PHP 5.3
CodeWorks '09 Webcast Series
June 26, 2009
2. Salut! Comment sa-va?
Senior Consultant at Blue Parabola
● Native of Duson, Louisiana
● Author and TE for php|architect Magazine
● Book coming soon from php|architect
● Contributor to Zend Framework project
3. A Long, Long Time Ago (Or Not)
● Alexander Stepanov
● Conceived of the
STL for C++
Goals of SPL are
4. In a Galaxy Not So Far Away
Pre-5.3 SPL Features
● Classes: ArrayObject, SplFileInfo...
● Interfaces: ArrayAccess, Countable...
● Exceptions: BadFunctionCallException...
● Functions: spl_autoload_register...
5. Oh yeah, and iterators.
6. So What's New?
In comparison to the STL:
● Iterators? Nope.
● Algorithms? Nope.
● Functors? Nope.
● Well, there's only one thing left then...
“A container is a class, a data structure,
or an abstract data type whose instances
are collections of other objects. They are
used to store objects in an organized way
following specific access rules.”
“Container (data structure)” - Wikipedia
8. We Don't Need
No Stinkin' Containers!
9. Sure We Do! Here's Why...
10. Arrays Are Great
● They're a general purpose container.
● This makes them flexible.
● Its underlying algorithm isn't always best.
● Operates similarly to a heap
● In fact, uses a heap internally for storage
● Accepts a priority with the element value
● Element with highest priority comes out first
43. Some Great SPL Resources
44. C'est tous!
● email@example.com or firstname.lastname@example.org
● Elazar on the Freenode IRC network
● Look for me in Dallas, Atlanta, Miami,
Washington, and New York City
at CodeWorks 2009!
● Watch for my book next quarter!
Source: Christian Flickinger