The Standard PHP Library (SPL) has been an option in PHP since version 5.0.0 and always available since 5.3.0, yet few developers seem aware of the powerful features that it offers. From a comprehensive set of iterators and powerful classes, interfaces and abstracts that seem complicated, but are surprisingly easy to use; through a hierarchy of exceptions; and datastructures; to file handling classes; to the Observer design pattern: the SPL has something to offer that can simplify your code, improve its performance and reduce its memory usage. Despite its wide and varied uses, SPL has been largely forgotten: but now it’s time that developers learned the powerful toolset that’s already available in PHP to simplify their work. SPL should take its place among the standard features of PHP that we use on a daily basis.
This talk takes a look at some of the datastructures that are built into PHP’s SPL library; why, when and how should you use them in your code; and what problems you might you encounter when doing so. Fixed Arrays; Doubly-linked lists; Stacks; Queues and Priority Queues; Heaps; and Object Storage: all have real benefits when used in the right situation. SPL offers real solutions to daily problems, and isn’t simply an esoteric collection of tools that only belong in a Computer Science theory classroom.
The SPL provides a powerful and flexible toolset: yet few developers even seem aware of its existence, or of how they can use it to simplify their work and improve the quality of their code. It’s time that changed; and SPL should take its place among the standard features of PHP that we use on a daily basis. This talk is aimed at reminding people that SPL offers real solutions to daily problems, and isn’t simply an esoteric collection of tools that only belong in a Computer Science theory classroom.
Mark is the Head of Design and Development at Innoved (Innovative Solutions for Education) based in Wigan; a company which (coincidentally) shares offices with his favourite Rugby League team, the 2013 Challenge Cup winners, and which occasionally gets him free tickets to attend Warriors games.
He has been working in the computer software industry since before symbolics.com was registered as a domain name, before the term “cyberspace” was first used in fiction, when Linus Torvalds and Rasmus Lerdorf were still at high school, and Mrs. Zuckerberg had yet to give birth to a bouncing baby social network enabler; and has been developing for the Web in a variety of languages since the days when the Tim Berners-Lee’s creation comprised less than 1,000 sites.
Over those years, he has contributed to a number of open source projects: some still extant, others lost to history. Currently he is coordinator and lead developer for the PHPExcel library, and a coordinator and developer on the PHPPowerpoint, PHPWord, PHPProject and PHPVisio libraries – all part of the PHPOffice library suite. He has also managed to squeeze his name into the credits for PHP 5.5 by contributing a new method to SPL Doubly-Linked Lists. Most recently, he has been working on new datastructures such as Tries, hoping that he’ll be able to get them included in SPL.
His particular interests include PHP integration with office suites, Textual analysis, Geodata and geographic information systems, and “big data” and data analysis.