The Standard PHP Library

These planned improvements to the MySQL classes use the Standard PHP Library (SPL), a collection of classes and interfaces aimed at solving common programming problems. The SPL, new to PHP 5, is roughly comparable to the Standard Template Library in C++ or the many classes built in to the Java language. But whereas there are thousands of classes to draw upon in Java, the number available in PHP is much more modest.

We'll use the Exception class to form the basis for a MySQLException class and the SPL to adapt the MySQLResultSet class for use with a foreach loop by using the Iterator interface. Besides the classes belonging to the SPL, there are well over 100 built-in classes in PHP 5. We'll deal with some of the other ...

Get Object-Oriented PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.