Largely ignored under PHP5, the SPL (Standard PHP Library) offered a powerful toolbox for developers, ranging from it’s horrendously named collection of Iterators, and a series of Interfaces allowing us to build our own, to DataStructures, and Object Oriented file handling classes. Fast and powerful, the SPL provided a stable and well-tested library of classes and functions. But with all the performance and memory improvements of PHP7, SPL has remained unchanged, and feels like it has been left behind. Now, Generators provide a simpler replacement for writing our own Iterators without all the boilerplate code that SPL’s core Iterators require, especially with the introduction of “yield from” in PHP7 for recursive Iterators. And PHP7’s performance improvements allow us to write our own Datastructures (based around standard PHP arrays, or custom objects) that are as efficient as SPL’s basic Datastructures.

So does SPL still have any purpose or value in this new world of PHP7? Let’s find out!

Comments

Comments are closed.

Martin V at 09:09 on 27 Jan 2018

I didn't know few SPL features, like types, thanks for that.

Michiel Kodde at 10:03 on 27 Jan 2018

Talk of the day for me. Mr. Baker clearly did his homework on this one!

Interesting talk.

Timo Schinkel at 09:29 on 29 Jan 2018

Great informative talk on the current state of SPL. I kind of hoped to get a strong answer on the question that is the title of this talk :)

Nice reminder of the good and bad in SPL

Interesting topic that brought some useful info, but missed a clear-cut conclusion because its nature. The presentation style was too laid back for me and the repetition about iterators and data structures (e.g. Rudi Theunissen's) was a bit too much.