From the course: Learning the Standard PHP Library

What is the Standard PHP Library? - PHP Tutorial

From the course: Learning the Standard PHP Library

Start my 1-month free trial

What is the Standard PHP Library?

- Before looking at individual aspects of the standard PHP library, I think it's important to explain what it is. The standard PHP library, or SPL for short, is standard in the sense that there's nothing to install. It's a core part of PHP. It was introduced in PHP 5.0, so it's been part of the language since 2004. Originally, it was possible to compile PHP without the SPL. But since PHP 5.3, it's become a default component and can't be disabled. Although it's called a library, SPL is not another framework like Symfony or CakePHP. So, what is it? According to the PHP online documentation, the standard PHP library (SPL) is a collection of interfaces and classes that are meant to solve common problems. At the time of recording this video, that's all it says. It's accurate, but not very helpful. So, let's take a look at the main index. The SPL defines a series of data structures such as doubly linked lists, stacks, queues and heaps. It also defines a large number of iterators for looping over arrays, objects, and the system file structure. If I scroll down to the bottom of this page, we can see that there are three classes that are dedicated to file handling. One of the problems with the SPL, is that the documentation isn't as user friendly as other core parts of PHP. So, that's the idea behind this course, to lift some of the mystery and to help you explore the secrets of the SPL beginning with iterators.

Contents